diff --git a/stl/inc/array b/stl/inc/array index d33d32a8c..2a21b121b 100644 --- a/stl/inc/array +++ b/stl/inc/array @@ -376,7 +376,7 @@ public: _Ty _Elems[1]; }; -template ::value>> +template ::value, int> = 0> void swap(array<_Ty, _Size>& _Left, array<_Ty, _Size>& _Right) noexcept(noexcept(_Left.swap(_Right))) { return _Left.swap(_Right); } diff --git a/stl/inc/chrono b/stl/inc/chrono index 7cac9a5a2..0db70fba7 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -58,7 +58,7 @@ namespace chrono { template _INLINE_VAR constexpr bool _Is_duration_v = _Is_specialization_v<_Ty, duration>; - template >> + template , int> = 0> constexpr _To duration_cast(const duration<_Rep, _Period>&) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v); // strengthened @@ -75,16 +75,18 @@ namespace chrono { constexpr duration() = default; template && (treat_as_floating_point_v<_Rep> || !treat_as_floating_point_v<_Rep2>)>> + enable_if_t && (treat_as_floating_point_v<_Rep> || !treat_as_floating_point_v<_Rep2>), + int> = 0> constexpr explicit duration(const _Rep2& _Val) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v<_Rep2>) // strengthened : _MyRep(static_cast<_Rep>(_Val)) {} template || (_Ratio_divide_sfinae<_Period2, _Period>::den == 1 && !treat_as_floating_point_v<_Rep2>)>> + _Rep> || (_Ratio_divide_sfinae<_Period2, _Period>::den == 1 && !treat_as_floating_point_v<_Rep2>), + int> = 0> constexpr duration(const duration<_Rep2, _Period2>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v<_Rep2>) // strengthened : _MyRep(chrono::duration_cast(_Dur).count()) {} @@ -185,7 +187,7 @@ namespace chrono { constexpr explicit time_point(const _Duration& _Other) noexcept(is_arithmetic_v) // strengthened : _MyDur(_Other) {} - template >> + template , int> = 0> constexpr time_point(const time_point<_Clock, _Duration2>& _Tp) noexcept( is_arithmetic_v&& is_arithmetic_v) // strengthened : _MyDur(_Tp.time_since_epoch()) {} @@ -256,7 +258,7 @@ namespace chrono { } template >>> + enable_if_t>, int> = 0> _NODISCARD constexpr duration, _Period1> operator*( const duration<_Rep1, _Period1>& _Left, const _Rep2& _Right) noexcept(is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -266,7 +268,7 @@ namespace chrono { } template >>> + enable_if_t>, int> = 0> _NODISCARD constexpr duration, _Period2> operator*(const _Rep1& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -372,7 +374,7 @@ namespace chrono { } // FUNCTION TEMPLATE duration_cast - template + template , int> _Enabled> _NODISCARD constexpr _To duration_cast(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { // convert duration to another duration; truncate @@ -403,7 +405,7 @@ namespace chrono { } // FUNCTION TEMPLATE floor - template >> + template , int> = 0> _NODISCARD constexpr _To floor(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { // convert duration to another duration; round towards negative infinity @@ -417,7 +419,7 @@ namespace chrono { } // FUNCTION TEMPLATE ceil - template >> + template , int> = 0> _NODISCARD constexpr _To ceil(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { // convert duration to another duration; round towards positive infinity @@ -438,7 +440,7 @@ namespace chrono { } template && !treat_as_floating_point_v>> + enable_if_t<_Is_duration_v<_To> && !treat_as_floating_point_v, int> = 0> _NODISCARD constexpr _To round(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { // convert duration to another duration, round to nearest, ties to even @@ -455,7 +457,7 @@ namespace chrono { } // FUNCTION TEMPLATE abs - template ::is_signed>> + template ::is_signed, int> = 0> _NODISCARD constexpr duration<_Rep, _Period> abs(const duration<_Rep, _Period> _Dur) noexcept( is_arithmetic_v<_Rep>) /* strengthened */ { // create a duration with count() the absolute value of _Dur.count() @@ -545,7 +547,7 @@ namespace chrono { } // FUNCTION TEMPLATE time_point_cast - template >> + template , int> = 0> _NODISCARD constexpr time_point<_Clock, _To> time_point_cast(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { // change the duration type of a time_point; truncate @@ -553,7 +555,7 @@ namespace chrono { } // FUNCTION TEMPLATE floor (for time_point instances) - template >> + template , int> = 0> _NODISCARD constexpr time_point<_Clock, _To> floor(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { // change the duration type of a time_point; round towards negative infinity @@ -561,7 +563,7 @@ namespace chrono { } // FUNCTION TEMPLATE ceil (for time_point instances) - template >> + template , int> = 0> _NODISCARD constexpr time_point<_Clock, _To> ceil(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { // change the duration type of a time_point; round towards positive infinity @@ -570,7 +572,7 @@ namespace chrono { // FUNCTION TEMPLATE round (for time_point instances) template && !treat_as_floating_point_v>> + enable_if_t<_Is_duration_v<_To> && !treat_as_floating_point_v, int> = 0> _NODISCARD constexpr time_point<_Clock, _To> round(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { // change the duration type of a time_point; round to nearest, ties to even diff --git a/stl/inc/complex b/stl/inc/complex index 06ae726e3..18ac5a86c 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -1774,13 +1774,13 @@ struct _Promote_to_float { // promote integral to double }; #define _GENERIC_MATHC0X(FUN, VAL) \ - template >> \ + template , int> = 0> \ _NODISCARD typename _Promote_to_float<_Ty>::type FUN(_Ty) { \ return static_cast::type>(VAL); \ } #define _GENERIC_MATHC1X(FUN, VAL) \ - template >> \ + template , int> = 0> \ _NODISCARD typename _Promote_to_float<_Ty>::type FUN(_Ty _Left) { \ return static_cast::type>(VAL); \ } @@ -1816,7 +1816,7 @@ _NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const _Ty1& _Left, cons return _STD pow(type(_Left), type(_Right)); } -template && is_integral_v<_Ty2>>> +template && is_integral_v<_Ty2>, int> = 0> _NODISCARD complex<_Ty1> pow(const complex<_Ty1>& _Left, _Ty2& _Right) { // raise Gaussian integer to an integer power using type = complex<_Ty1>; diff --git a/stl/inc/deque b/stl/inc/deque index 2d5a6b949..131c24425 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -638,7 +638,7 @@ public: _Proxy._Release(); } - template >> + template , int> = 0> deque(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t()) { _Alproxy_ty _Alproxy(_Getal()); _Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data()); @@ -646,7 +646,7 @@ public: _Proxy._Release(); } - template >> + template , int> = 0> deque(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) { _Alproxy_ty _Alproxy(_Getal()); _Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data()); @@ -1147,7 +1147,7 @@ public: #endif // _ITERATOR_DEBUG_LEVEL == 2 } - template >> + template , int> = 0> void assign(_Iter _First, _Iter _Last) { _Orphan_all(); _Adl_verify_range(_First, _Last); @@ -1214,7 +1214,7 @@ public: return begin() + static_cast(_Off); } - template >> + template , int> = 0> iterator insert(const_iterator _Where, _Iter _First, _Iter _Last) { // insert [_First, _Last) at _Where, input iterators size_type _Off = static_cast(_Where - begin()); diff --git a/stl/inc/experimental/filesystem b/stl/inc/experimental/filesystem index 11baf2f3e..dd7c1b21e 100644 --- a/stl/inc/experimental/filesystem +++ b/stl/inc/experimental/filesystem @@ -749,7 +749,7 @@ public: // ARBITRARY SOURCE CONSTRUCT - template >> + template , int> = 0> path(_InIt _First, _InIt _Last) { using _Valty = _Iter_value_t<_InIt>; basic_string<_Valty> _Str(_First, _Last); @@ -757,7 +757,7 @@ public: *this /= _Path_cvt<_Valty, value_type>::_Cvt(_Str_out, _Str.c_str(), _Str.size()); } - template >> + template , int> = 0> path(_InIt _First) { using _Valty = _Iter_value_t<_InIt>; basic_string<_Valty> _Str; @@ -777,7 +777,7 @@ public: // ARBITRARY SOURCE CONSTRUCT, WITH LOCALE - template >> + template , int> = 0> path(_InIt _First, _InIt _Last, const locale& _Loc) { using _Valty = _Iter_value_t<_InIt>; basic_string<_Valty> _Str(_First, _Last); @@ -785,7 +785,7 @@ public: *this /= _Path_cvt<_Valty, value_type>::_Cvt(_Str_out, _Str.c_str(), _Str.size(), _Loc); } - template >> + template , int> = 0> path(_InIt _First, const locale& _Loc) { using _Valty = _Iter_value_t<_InIt>; basic_string<_Valty> _Str; @@ -1305,14 +1305,14 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, } // FUNCTION TEMPLATE u8path -template >> +template , int> = 0> _NODISCARD path u8path(_InIt _First, _InIt _Last) { // make path from [_First, _Last) UTF8, given iterators string _Str(_First, _Last); path::string_type _Str_out; return path(_Path_cvt<_Char8_t, _Pchar>::_Cvt(_Str_out, _Str.c_str(), _Str.size())); } -template >> +template , int> = 0> _NODISCARD path u8path(_InIt _First) { // make path from NTBS UTF8, given iterator string _Str; for (; *_First != '\0'; ++_First) { diff --git a/stl/inc/forward_list b/stl/inc/forward_list index b1a6497e2..5b8126f9b 100644 --- a/stl/inc/forward_list +++ b/stl/inc/forward_list @@ -560,7 +560,7 @@ public: _Insert_op._Attach_after(_Mypair._Myval2._Before_head()); } - template >> + template , int> = 0> forward_list(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t()) { _Adl_verify_range(_First, _Last); _Flist_insert_after_op<_Alnode> _Insert_op(_Getal()); @@ -569,7 +569,7 @@ public: _Insert_op._Attach_after(_Mypair._Myval2._Before_head()); } - template >> + template , int> = 0> forward_list(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) { _Adl_verify_range(_First, _Last); _Flist_insert_after_op<_Alnode> _Insert_op(_Getal()); @@ -908,7 +908,7 @@ private: } public: - template >> + template , int> = 0> void assign(_Iter _First, _Iter _Last) { _Adl_verify_range(_First, _Last); _Assign_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); @@ -944,7 +944,7 @@ public: return _Make_iter(_Where._Ptr); } - template >> + template , int> = 0> iterator insert_after(const_iterator _Where, _Iter _First, _Iter _Last) { // insert [_First, _Last) after _Where #if _ITERATOR_DEBUG_LEVEL == 2 diff --git a/stl/inc/functional b/stl/inc/functional index 8f86d262c..662f98020 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -894,7 +894,7 @@ public: using _Mybase = _Func_base<_Rx, _Types...>; using _Nothrow_move = is_nothrow_move_constructible<_Callable>; - template >>> + template >, int> = 0> explicit _Func_impl_no_alloc(_Other&& _Val) : _Callee(_STD forward<_Other>(_Val)) {} // dtor non-virtual due to _Delete_this() diff --git a/stl/inc/future b/stl/inc/future index b58926499..3731bf9e2 100644 --- a/stl/inc/future +++ b/stl/inc/future @@ -1352,7 +1352,7 @@ public: packaged_task() noexcept : _MyPromise(0) {} - template , packaged_task>>> + template , packaged_task>, int> = 0> explicit packaged_task(_Fty2&& _Fnarg) : _MyPromise(new _MyStateType(_STD forward<_Fty2>(_Fnarg))) {} packaged_task(packaged_task&& _Other) noexcept : _MyPromise(_STD move(_Other._MyPromise)) {} @@ -1363,7 +1363,7 @@ public: } #if _HAS_FUNCTION_ALLOCATOR_SUPPORT - template , packaged_task>>> + template , packaged_task>, int> = 0> packaged_task(allocator_arg_t, const _Alloc& _Al, _Fty2&& _Fnarg) : _MyPromise(_Make_packaged_state<_MyStateType>(_STD forward<_Fty2>(_Fnarg), _Al)) {} #endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT diff --git a/stl/inc/hash_map b/stl/inc/hash_map index a90f093f5..38b129e13 100644 --- a/stl/inc/hash_map +++ b/stl/inc/hash_map @@ -190,12 +190,12 @@ namespace stdext { using _Mybase::insert; - template >> + template >> // TRANSITION, GH-249 pair insert(_Valty&& _Val) { return this->emplace(_STD forward<_Valty>(_Val)); } - template >> + template >> // TRANSITION, GH-249 iterator insert(const_iterator _Where, _Valty&& _Val) { return this->emplace_hint(_Where, _STD forward<_Valty>(_Val)); } @@ -373,12 +373,12 @@ namespace stdext { using _Mybase::insert; - template >> + template >> // TRANSITION, GH-249 iterator insert(_Valty&& _Val) { return this->emplace(_STD forward<_Valty>(_Val)); } - template >> + template >> // TRANSITION, GH-249 iterator insert(const_iterator _Where, _Valty&& _Val) { return this->emplace_hint(_Where, _STD forward<_Valty>(_Val)); } diff --git a/stl/inc/list b/stl/inc/list index b49799830..bf2d63d4d 100644 --- a/stl/inc/list +++ b/stl/inc/list @@ -855,13 +855,13 @@ public: _Construct_range_unchecked(_Right._Unchecked_begin(), _Right._Unchecked_end()); } - template >> + template , int> = 0> list(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t()) { _Adl_verify_range(_First, _Last); _Construct_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); } - template >> + template , int> = 0> list(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) { _Adl_verify_range(_First, _Last); _Construct_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); @@ -1267,7 +1267,7 @@ private: } public: - template >> + template , int> = 0> void assign(_Iter _First, _Iter _Last) { _Assign_cast(_Get_unwrapped(_First), _Get_unwrapped(_Last)); } @@ -1313,7 +1313,7 @@ public: return _Make_iter(_Op._Attach_before(_Mypair._Myval2, _Where._Ptr)); } - template >> + template , int> = 0> iterator insert(const const_iterator _Where, _Iter _First, _Iter _Last) { // insert [_First, _Last) before _Where #if _ITERATOR_DEBUG_LEVEL == 2 _STL_VERIFY(_Where._Getcont() == _STD addressof(_Mypair._Myval2), "list insert iterator outside range"); diff --git a/stl/inc/map b/stl/inc/map index 2d93d3815..26a664d65 100644 --- a/stl/inc/map +++ b/stl/inc/map @@ -160,12 +160,12 @@ public: using _Mybase::insert; - template >> + template , int> = 0> pair insert(_Valty&& _Val) { return this->emplace(_STD forward<_Valty>(_Val)); } - template >> + template , int> = 0> iterator insert(const_iterator _Where, _Valty&& _Val) { return this->emplace_hint(_Where, _STD forward<_Valty>(_Val)); } @@ -464,12 +464,12 @@ public: using _Mybase::insert; - template >> + template , int> = 0> iterator insert(_Valty&& _Val) { return this->emplace(_STD forward<_Valty>(_Val)); } - template >> + template , int> = 0> iterator insert(const_iterator _Where, _Valty&& _Val) { return this->emplace_hint(_Where, _STD forward<_Valty>(_Val)); } diff --git a/stl/inc/memory b/stl/inc/memory index daefe3e12..46d7f7ede 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -1931,11 +1931,12 @@ public: constexpr unique_ptr() noexcept : _Mypair(_Zero_then_variadic_args_t()) {} template > - using _Enable_ctor_reset = enable_if_t // - || _Is_nullptr::value // - || (is_same_v // - && is_pointer_v<_Uty> // - && is_convertible_v (*)[], element_type (*)[]>)>; + using _Enable_ctor_reset = + enable_if_t // + || _Is_nullptr::value // + || (is_same_v // + && is_pointer_v<_Uty> // + && is_convertible_v (*)[], element_type (*)[]>)>; // TRANSITION, GH-248 template = 0, class = _Enable_ctor_reset<_Uty>> explicit unique_ptr(_Uty _Ptr) noexcept : _Mypair(_Zero_then_variadic_args_t(), _Ptr) {} @@ -1974,8 +1975,9 @@ public: template ::pointer, class _UP_element_type = typename unique_ptr<_Uty, _Ex>::element_type> - using _Enable_conversion = enable_if_t, is_same, - is_same<_UP_pointer, _UP_element_type*>, is_convertible<_UP_element_type (*)[], element_type (*)[]>, _More>>; + using _Enable_conversion = enable_if_t< + conjunction_v, is_same, is_same<_UP_pointer, _UP_element_type*>, + is_convertible<_UP_element_type (*)[], element_type (*)[]>, _More>>; // TRANSITION, GH-248 template , thread>>> + template , thread>, int> = 0> explicit thread(_Fn&& _Fx, _Args&&... _Ax) { using _Tuple = tuple, decay_t<_Args>...>; auto _Decay_copied = _STD make_unique<_Tuple>(_STD forward<_Fn>(_Fx), _STD forward<_Args>(_Ax)...); diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 1d8b28ac4..888fdc4ef 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1924,13 +1924,13 @@ struct _Is_nothrow_swappable; // FUNCTION TEMPLATE swap #if _HAS_CXX17 -template && is_move_assignable_v<_Ty>>> +template && is_move_assignable_v<_Ty>, int> = 0> #else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv -template +template #endif // _HAS_CXX17 void swap(_Ty&, _Ty&) noexcept(is_nothrow_move_constructible_v<_Ty>&& is_nothrow_move_assignable_v<_Ty>); -template ::value>> +template ::value, int> = 0> void swap(_Ty (&)[_Size], _Ty (&)[_Size]) noexcept(_Is_nothrow_swappable<_Ty>::value); // STRUCT TEMPLATE _Swappable_with_helper diff --git a/stl/inc/unordered_map b/stl/inc/unordered_map index e8b647aa1..6ea76ebf4 100644 --- a/stl/inc/unordered_map +++ b/stl/inc/unordered_map @@ -234,12 +234,12 @@ public: using _Mybase::insert; - template >> + template , int> = 0> pair insert(_Valty&& _Val) { return this->emplace(_STD forward<_Valty>(_Val)); } - template >> + template , int> = 0> iterator insert(const_iterator _Where, _Valty&& _Val) { return this->emplace_hint(_Where, _STD forward<_Valty>(_Val)); } @@ -641,12 +641,12 @@ public: using _Mybase::insert; - template >> + template , int> = 0> iterator insert(_Valty&& _Val) { return this->emplace(_STD forward<_Valty>(_Val)); } - template >> + template , int> = 0> iterator insert(const_iterator _Where, _Valty&& _Val) { return this->emplace_hint(_Where, _STD forward<_Valty>(_Val)); } diff --git a/stl/inc/utility b/stl/inc/utility index 2c318ea48..edaaa4a2f 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -44,7 +44,7 @@ void iter_swap(_FwdIt1 _Left, _FwdIt2 _Right) { // swap *_Left and *_Right } // FUNCTION TEMPLATE swap -template +template ::value, int> _Enabled> void swap(_Ty (&_Left)[_Size], _Ty (&_Right)[_Size]) noexcept(_Is_nothrow_swappable<_Ty>::value) { if (&_Left != &_Right) { _Ty* _First1 = _Left; @@ -56,7 +56,11 @@ void swap(_Ty (&_Left)[_Size], _Ty (&_Right)[_Size]) noexcept(_Is_nothrow_swappa } } -template +#if _HAS_CXX17 +template && is_move_assignable_v<_Ty>, int> _Enabled> +#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv +template +#endif // _HAS_CXX17 void swap(_Ty& _Left, _Ty& _Right) noexcept(is_nothrow_move_constructible_v<_Ty>&& is_nothrow_move_assignable_v<_Ty>) { _Ty _Tmp = _STD move(_Left); _Left = _STD move(_Right); @@ -291,7 +295,7 @@ template pair(_Ty1, _Ty2)->pair<_Ty1, _Ty2>; #endif // _HAS_CXX17 -template ::value && _Is_swappable<_Ty2>::value>> +template ::value && _Is_swappable<_Ty2>::value, int> = 0> void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>& _Right) noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } diff --git a/stl/inc/vector b/stl/inc/vector index 15e292759..cfee72f9b 100644 --- a/stl/inc/vector +++ b/stl/inc/vector @@ -500,7 +500,7 @@ private: } public: - template >> + template , int> = 0> vector(_Iter _First, _Iter _Last, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t(), _Al) { auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal()); _Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2); @@ -1013,7 +1013,7 @@ private: } public: - template >> + template , int> = 0> iterator insert(const_iterator _Where, _Iter _First, _Iter _Last) { const pointer _Whereptr = _Where._Ptr; auto& _My_data = _Mypair._Myval2; @@ -1136,7 +1136,7 @@ private: } public: - template >> + template , int> = 0> void assign(_Iter _First, _Iter _Last) { _Adl_verify_range(_First, _Last); _Assign_range(_Get_unwrapped(_First), _Get_unwrapped(_Last), _Iter_cat_t<_Iter>{}); @@ -2295,7 +2295,7 @@ public: vector(const vector& _Right, const _Alloc& _Al) : _Mybase(_Right, _Al) {} - template >> + template , int> = 0> vector(_Iter _First, _Iter _Last, const _Alloc& _Al = _Alloc()) : _Mybase(_Al) { _BConstruct(_First, _Last); } @@ -2645,7 +2645,7 @@ public: erase(end() - 1); } - template >> + template , int> = 0> void assign(_Iter _First, _Iter _Last) { clear(); insert(begin(), _First, _Last); @@ -2664,7 +2664,7 @@ public: return _Insert_n(_Where, _Count, _Val); } - template >> + template , int> = 0> iterator insert(const_iterator _Where, _Iter _First, _Iter _Last) { difference_type _Off = _Where - begin(); _Insert(_Where, _First, _Last, _Iter_cat_t<_Iter>()); diff --git a/stl/inc/xhash b/stl/inc/xhash index ebce687a6..948aaf055 100644 --- a/stl/inc/xhash +++ b/stl/inc/xhash @@ -1233,7 +1233,7 @@ private: } public: - template >> + template , int> = 0> iterator erase(iterator _Plist) noexcept(_Nothrow_hash<_Traits, key_type>) /* strengthened */ { return _List._Make_iter(_Unchecked_erase(_Plist._Ptr)); } diff --git a/stl/inc/xstring b/stl/inc/xstring index ef7d278c6..3033d6d6a 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -2263,7 +2263,8 @@ private: template using _Is_string_view_ish = enable_if_t>, - negation>>>; + negation>>, + int>; #endif // _HAS_CXX17 public: @@ -2370,7 +2371,7 @@ public: _Proxy._Release(); } - template >> + template , int> = 0> basic_string(_Iter _First, _Iter _Last, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t(), _Al) { auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal()); _Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2); @@ -2437,7 +2438,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> explicit basic_string(const _StringViewIsh& _Right, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t(), _Al) { auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal()); @@ -2447,7 +2448,7 @@ public: _Proxy._Release(); } - template > + template = 0> basic_string( const _StringViewIsh& _Right, const size_type _Roff, const size_type _Count, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t(), _Al) { // construct from _Right [_Roff, _Roff + _Count) using _Al @@ -2697,7 +2698,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> basic_string& operator=(const _StringViewIsh& _Right) { return assign(_Right); } @@ -2720,7 +2721,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> basic_string& operator+=(const _StringViewIsh& _Right) { return append(_Right); } @@ -2747,13 +2748,13 @@ public: } #if _HAS_CXX17 - template > + template = 0> basic_string& append(const _StringViewIsh& _Right) { const basic_string_view<_Elem, _Traits> _As_view = _Right; return append(_As_view.data(), _Convert_size(_As_view.size())); } - template > + template = 0> basic_string& append(const _StringViewIsh& _Right, const size_type _Roff, const size_type _Count = npos) { // append _Right [_Roff, _Roff + _Count) basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -2809,7 +2810,7 @@ public: } #if _HAS_IF_CONSTEXPR - template >> + template , int> = 0> basic_string& append(const _Iter _First, const _Iter _Last) { // append [_First, _Last), input iterators _Adl_verify_range(_First, _Last); const auto _UFirst = _Get_unwrapped(_First); @@ -2833,7 +2834,7 @@ public: return append(_Right._Mypair._Myval2._Myptr(), _Right._Mypair._Myval2._Mysize); } - template >> + template , int> = 0> basic_string& append(const _Iter _First, const _Iter _Last) { // append [_First, _Last), input iterators { _Adl_verify_range(_First, _Last); const auto _UFirst = _Get_unwrapped(_First); @@ -2854,13 +2855,13 @@ public: } #if _HAS_CXX17 - template > + template = 0> basic_string& assign(const _StringViewIsh& _Right) { const basic_string_view<_Elem, _Traits> _As_view = _Right; return assign(_As_view.data(), _Convert_size(_As_view.size())); } - template > + template = 0> basic_string& assign(const _StringViewIsh& _Right, const size_type _Roff, const size_type _Count = npos) { // assign _Right [_Roff, _Roff + _Count) basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -2910,7 +2911,7 @@ public: } #if _HAS_IF_CONSTEXPR - template >> + template , int> = 0> basic_string& assign(const _Iter _First, const _Iter _Last) { _Adl_verify_range(_First, _Last); const auto _UFirst = _Get_unwrapped(_First); @@ -2946,7 +2947,7 @@ public: } } - template >> + template , int> = 0> basic_string& assign(const _Iter _First, const _Iter _Last) { _Adl_verify_range(_First, _Last); const auto _UFirst = _Get_unwrapped(_First); @@ -2967,13 +2968,13 @@ public: } #if _HAS_CXX17 - template > + template = 0> basic_string& insert(const size_type _Off, const _StringViewIsh& _Right) { // insert _Right at _Off const basic_string_view<_Elem, _Traits> _As_view = _Right; return insert(_Off, _As_view.data(), _Convert_size(_As_view.size())); } - template > + template = 0> basic_string& insert(const size_type _Off, const _StringViewIsh& _Right, const size_type _Roff, const size_type _Count = npos) { // insert _Right [_Roff, _Roff + _Count) at _Off basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -3068,7 +3069,7 @@ public: } #if _HAS_IF_CONSTEXPR - template >> + template , int> = 0> iterator insert(const const_iterator _Where, const _Iter _First, const _Iter _Last) { // insert [_First, _Last) at _Where, input iterators #if _ITERATOR_DEBUG_LEVEL != 0 @@ -3099,7 +3100,7 @@ public: insert(_Off, _Right._Mypair._Myval2._Myptr(), _Right._Mypair._Myval2._Mysize); } - template >> + template , int> = 0> iterator insert(const const_iterator _Where, const _Iter _First, const _Iter _Last) { // insert [_First, _Last) at _Where, input iterators #if _ITERATOR_DEBUG_LEVEL != 0 @@ -3168,14 +3169,14 @@ public: } #if _HAS_CXX17 - template > + template = 0> basic_string& replace(const size_type _Off, const size_type _N0, const _StringViewIsh& _Right) { // replace [_Off, _Off + _N0) with _Right basic_string_view<_Elem, _Traits> _As_view = _Right; return replace(_Off, _N0, _As_view.data(), _Convert_size(_As_view.size())); } - template > + template = 0> basic_string& replace(const size_type _Off, const size_type _N0, const _StringViewIsh& _Right, const size_type _Roff, const size_type _Count = npos) { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count) @@ -3292,7 +3293,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> basic_string& replace(const const_iterator _First, const const_iterator _Last, const _StringViewIsh& _Right) { // replace [_First, _Last) with _Right _Adl_verify_range(_First, _Last); @@ -3337,7 +3338,7 @@ public: } #if _HAS_IF_CONSTEXPR - template >> + template , int> = 0> basic_string& replace( const const_iterator _First, const const_iterator _Last, const _Iter _First2, const _Iter _Last2) { // replace [_First, _Last) with [_First2, _Last2), input iterators @@ -3373,7 +3374,7 @@ public: return replace(_Off, _Length, _Right._Mypair._Myval2._Myptr(), _Right._Mypair._Myval2._Mysize); } - template >> + template , int> = 0> basic_string& replace( const const_iterator _First, const const_iterator _Last, const _Iter _First2, const _Iter _Last2) { // replace [_First, _Last) with [_First2, _Last2), input iterators @@ -3760,7 +3761,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> _NODISCARD size_type find(const _StringViewIsh& _Right, const size_type _Off = 0) const { // look for _Right beginning at or after _Off basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -3796,7 +3797,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> _NODISCARD size_type rfind(const _StringViewIsh& _Right, const size_type _Off = npos) const { // look for _Right beginning before _Off basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -3832,7 +3833,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> _NODISCARD size_type find_first_of(const _StringViewIsh& _Right, const size_type _Off = 0) const { // look for one of _Right at or after _Off basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -3869,7 +3870,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> _NODISCARD size_type find_last_of(const _StringViewIsh& _Right, const size_type _Off = npos) const { // look for one of _Right before _Off basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -3906,7 +3907,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> _NODISCARD size_type find_first_not_of(const _StringViewIsh& _Right, const size_type _Off = 0) const { // look for none of _Right at or after _Off basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -3945,7 +3946,7 @@ public: } #if _HAS_CXX17 - template > + template = 0> _NODISCARD size_type find_last_not_of(const _StringViewIsh& _Right, const size_type _Off = npos) const { // look for none of _Right before _Off basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -4004,14 +4005,14 @@ public: } #if _HAS_CXX17 - template > + template = 0> _NODISCARD int compare(const _StringViewIsh& _Right) const { // compare [0, size()) with _Right basic_string_view<_Elem, _Traits> _As_view = _Right; return _Traits_compare<_Traits>( _Mypair._Myval2._Myptr(), _Mypair._Myval2._Mysize, _As_view.data(), _As_view.size()); } - template > + template = 0> _NODISCARD int compare(const size_type _Off, const size_type _N0, const _StringViewIsh& _Right) const { // compare [_Off, _Off + _N0) with _Right basic_string_view<_Elem, _Traits> _As_view = _Right; @@ -4020,7 +4021,7 @@ public: _As_view.data(), _As_view.size()); } - template > + template = 0> _NODISCARD int compare(const size_type _Off, const size_type _N0, const _StringViewIsh& _Right, const size_type _Roff, const size_type _Count = npos) const { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count) diff --git a/stl/inc/xtgmath.h b/stl/inc/xtgmath.h index bf1383bf2..1ddd5f716 100644 --- a/stl/inc/xtgmath.h +++ b/stl/inc/xtgmath.h @@ -27,13 +27,13 @@ using _Common_float_type_t = conditional_t || is_sa _STD_END // FUNCTION TEMPLATE frexp -template >> +template , int> = 0> double frexp(_Ty _Value, _Out_ int* const _Exp) noexcept /* strengthened */ { return _CSTD frexp(static_cast(_Value), _Exp); } // FUNCTION TEMPLATE pow -template && _STD is_arithmetic_v<_Ty2>>> +template && _STD is_arithmetic_v<_Ty2>, int> = 0> _NODISCARD _STD _Common_float_type_t<_Ty1, _Ty2> pow(const _Ty1 _Left, const _Ty2 _Right) noexcept /* strengthened */ { using _Common = _STD _Common_float_type_t<_Ty1, _Ty2>; return _CSTD pow(static_cast<_Common>(_Left), static_cast<_Common>(_Right)); @@ -55,7 +55,7 @@ inline long double _Fma(long double _Left, long double _Middle, long double _Rig #endif // !_HAS_IF_CONSTEXPR template && _STD is_arithmetic_v<_Ty2> && _STD is_arithmetic_v<_Ty3>>> + _STD enable_if_t<_STD is_arithmetic_v<_Ty1> && _STD is_arithmetic_v<_Ty2> && _STD is_arithmetic_v<_Ty3>, int> = 0> _NODISCARD _STD _Common_float_type_t<_Ty1, _STD _Common_float_type_t<_Ty2, _Ty3>> fma( _Ty1 _Left, _Ty2 _Middle, _Ty3 _Right) noexcept /* strengthened */ { using _Common = _STD _Common_float_type_t<_Ty1, _STD _Common_float_type_t<_Ty2, _Ty3>>; @@ -87,7 +87,7 @@ inline long double _Remquo(long double _Left, long double _Right, int* _Pquo) no } #endif // !_HAS_IF_CONSTEXPR -template && _STD is_arithmetic_v<_Ty2>>> +template && _STD is_arithmetic_v<_Ty2>, int> = 0> _STD _Common_float_type_t<_Ty1, _Ty2> remquo(_Ty1 _Left, _Ty2 _Right, int* _Pquo) noexcept /* strengthened */ { using _Common = _STD _Common_float_type_t<_Ty1, _Ty2>; #if _HAS_IF_CONSTEXPR @@ -103,23 +103,23 @@ _STD _Common_float_type_t<_Ty1, _Ty2> remquo(_Ty1 _Left, _Ty2 _Right, int* _Pquo #endif // _HAS_IF_CONSTEXPR } -#define _GENERIC_MATH1R(FUN, RET) \ - template >> \ - _NODISCARD RET FUN(_Ty _Left) noexcept /* strengthened */ { \ - return _CSTD FUN(static_cast(_Left)); \ +#define _GENERIC_MATH1R(FUN, RET) \ + template , int> = 0> \ + _NODISCARD RET FUN(_Ty _Left) noexcept /* strengthened */ { \ + return _CSTD FUN(static_cast(_Left)); \ } #define _GENERIC_MATH1(FUN) _GENERIC_MATH1R(FUN, double) #define _GENERIC_MATH1X(FUN, ARG2) \ - template >> \ + template , int> = 0> \ _NODISCARD double FUN(_Ty _Left, ARG2 _Arg2) noexcept /* strengthened */ { \ return _CSTD FUN(static_cast(_Left), _Arg2); \ } #define _GENERIC_MATH2(FUN) \ template && _STD is_arithmetic_v<_Ty2>>> \ + _STD enable_if_t<_STD is_arithmetic_v<_Ty1> && _STD is_arithmetic_v<_Ty2>, int> = 0> \ _NODISCARD _STD _Common_float_type_t<_Ty1, _Ty2> FUN(_Ty1 _Left, _Ty2 _Right) noexcept /* strengthened */ { \ using _Common = _STD _Common_float_type_t<_Ty1, _Ty2>; \ return _CSTD FUN(static_cast<_Common>(_Left), static_cast<_Common>(_Right)); \ diff --git a/stl/inc/xtree b/stl/inc/xtree index 307e31e27..e9c0b2d9d 100644 --- a/stl/inc/xtree +++ b/stl/inc/xtree @@ -1407,7 +1407,7 @@ private: } public: - template >> + template , int> = 0> iterator erase(iterator _Where) noexcept /* strengthened */ { const auto _Scary = _Get_scary(); #if _ITERATOR_DEBUG_LEVEL == 2 diff --git a/stl/inc/xutility b/stl/inc/xutility index 154b3ce18..e1bf17e5f 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -4528,7 +4528,7 @@ _NODISCARD bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, } #if _ITERATOR_DEBUG_ARRAY_OVERLOADS -template >> +template , int> = 0> _NODISCARD bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _RightTy (&_First2)[_RightSize], _Pr _Pred) { // test if [_First1, _Last1) == permuted [_First2, ...), using _Pred return _STD is_permutation(_First1, _Last1, _Array_iterator<_RightTy, _RightSize>(_First2), _Pass_fn(_Pred));