diff --git a/stl/inc/functional b/stl/inc/functional index 69b4d85d54d..fc68beb46b6 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -855,12 +855,6 @@ private: _Callable _Callee; }; -#ifdef __CUDACC__ // TRANSITION, CUDA -#define _USE_FUNCTION_INT_0_SFINAE 0 -#else -#define _USE_FUNCTION_INT_0_SFINAE 1 -#endif // __CUDACC__ - template class _Func_class : public _Arg_types<_Types...> { public: @@ -1044,11 +1038,7 @@ public: this->_Reset_copy(_Right); } -#if _USE_FUNCTION_INT_0_SFINAE template = 0> -#else // ^^^ _USE_FUNCTION_INT_0_SFINAE // !_USE_FUNCTION_INT_0_SFINAE vvv - template > -#endif // _USE_FUNCTION_INT_0_SFINAE function(_Fx&& _Func) { this->_Reset(_STD forward<_Fx>(_Func)); } @@ -1065,11 +1055,7 @@ public: this->_Reset_alloc(_Right, _Ax); } -#if _USE_FUNCTION_INT_0_SFINAE template = 0> -#else // ^^^ _USE_FUNCTION_INT_0_SFINAE // !_USE_FUNCTION_INT_0_SFINAE vvv - template > -#endif // _USE_FUNCTION_INT_0_SFINAE function(allocator_arg_t, const _Alloc& _Ax, _Fx&& _Func) { this->_Reset_alloc(_STD forward<_Fx>(_Func), _Ax); } @@ -1099,11 +1085,7 @@ public: return *this; } -#if _USE_FUNCTION_INT_0_SFINAE template = 0> -#else // ^^^ _USE_FUNCTION_INT_0_SFINAE // !_USE_FUNCTION_INT_0_SFINAE vvv - template > -#endif // _USE_FUNCTION_INT_0_SFINAE function& operator=(_Fx&& _Func) { function(_STD forward<_Fx>(_Func)).swap(*this); return *this; diff --git a/stl/inc/memory b/stl/inc/memory index 784a2250261..299c13f7830 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -3272,23 +3272,39 @@ public: template > 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 + || _Is_nullptr::value // + || (is_same_v // + && is_pointer_v<_Uty> // + && is_convertible_v (*)[], element_type (*)[]>), + int>; +#ifdef _M_CEE // TRANSITION, VSO-1595465 template = 0, class = _Enable_ctor_reset<_Uty>> - _CONSTEXPR23 explicit unique_ptr(_Uty _Ptr) noexcept : _Mypair(_Zero_then_variadic_args_t{}, _Ptr) {} +#else // ^^^ workaround / no workaround vvv + template = 0, _Enable_ctor_reset<_Uty> = 0> +#endif // ^^^ no workaround ^^^ + _CONSTEXPR23 explicit unique_ptr(_Uty _Ptr) noexcept : _Mypair(_Zero_then_variadic_args_t{}, _Ptr) { + } template , int> = 0, +#ifdef _M_CEE // TRANSITION, VSO-1595465 class = _Enable_ctor_reset<_Uty>> - _CONSTEXPR23 unique_ptr(_Uty _Ptr, const _Dx& _Dt) noexcept : _Mypair(_One_then_variadic_args_t{}, _Dt, _Ptr) {} +#else // ^^^ workaround / no workaround vvv + _Enable_ctor_reset<_Uty> = 0> +#endif // ^^^ no workaround ^^^ + _CONSTEXPR23 unique_ptr(_Uty _Ptr, const _Dx& _Dt) noexcept : _Mypair(_One_then_variadic_args_t{}, _Dt, _Ptr) { + } template >, is_constructible<_Dx2, _Dx2>>, int> = 0, +#ifdef _M_CEE // TRANSITION, VSO-1595465 class = _Enable_ctor_reset<_Uty>> +#else // ^^^ workaround / no workaround vvv + _Enable_ctor_reset<_Uty> = 0> +#endif // ^^^ no workaround ^^^ _CONSTEXPR23 unique_ptr(_Uty _Ptr, _Dx&& _Dt) noexcept - : _Mypair(_One_then_variadic_args_t{}, _STD move(_Dt), _Ptr) {} + : _Mypair(_One_then_variadic_args_t{}, _STD move(_Dt), _Ptr) { + } template , is_constructible<_Dx2, remove_reference_t<_Dx2>>>, int> = 0> @@ -3312,15 +3328,26 @@ public: class _UP_element_type = typename unique_ptr<_Uty, _Ex>::element_type> 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 + is_convertible<_UP_element_type (*)[], element_type (*)[]>, _More>, + int>; template , is_same<_Ex, _Dx>, is_convertible<_Ex, _Dx>>>> +#else // ^^^ workaround / no workaround vvv + _Enable_conversion<_Uty, _Ex, conditional_t, is_same<_Ex, _Dx>, is_convertible<_Ex, _Dx>>> = + 0> +#endif // ^^^ no workaround ^^^ _CONSTEXPR23 unique_ptr(unique_ptr<_Uty, _Ex>&& _Right) noexcept - : _Mypair(_One_then_variadic_args_t{}, _STD forward<_Ex>(_Right.get_deleter()), _Right.release()) {} + : _Mypair(_One_then_variadic_args_t{}, _STD forward<_Ex>(_Right.get_deleter()), _Right.release()) { + } +#ifdef _M_CEE // TRANSITION, VSO-1595465 template >> +#else // ^^^ workaround / no workaround vvv + template > = 0> +#endif // ^^^ no workaround ^^^ _CONSTEXPR23 unique_ptr& operator=(unique_ptr<_Uty, _Ex>&& _Right) noexcept { reset(_Right.release()); _Mypair._Get_first() = _STD forward<_Ex>(_Right._Mypair._Get_first()); @@ -3374,7 +3401,11 @@ public: return _STD exchange(_Mypair._Myval2, nullptr); } +#ifdef _M_CEE // TRANSITION, VSO-1595465 template > +#else // ^^^ workaround / no workaround vvv + template = 0> +#endif // ^^^ no workaround ^^^ _CONSTEXPR23 void reset(_Uty _Ptr) noexcept { pointer _Old = _STD exchange(_Mypair._Myval2, _Ptr); if (_Old) {