diff --git a/stl/inc/functional b/stl/inc/functional index 662f98020d3..9d4e2bb90af 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -949,6 +949,13 @@ private: }; #pragma warning(pop) +// TRANSITION, Visual Studio 2019 16.5 + CUDA +#if (defined(_MSC_VER) && _MSC_VER < 1925) || defined(__CUDACC__) +#define _USE_FUNCTION_INT_0_SFINAE 0 +#else +#define _USE_FUNCTION_INT_0_SFINAE 1 +#endif // (defined(_MSC_VER) && _MSC_VER < 1925) || defined(__CUDACC__) + // CLASS TEMPLATE _Func_class template class _Func_class : public _Arg_types<_Types...> { @@ -976,7 +983,8 @@ public: protected: template using _Enable_if_callable_t = - enable_if_t, _Function>>, _Is_invocable_r<_Ret, _Fx, _Types...>>>; + enable_if_t, _Function>>, _Is_invocable_r<_Ret, _Fx, _Types...>>, + int>; bool _Empty() const noexcept { return !_Getimpl(); @@ -1125,7 +1133,11 @@ 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 move(_Func)); } @@ -1142,7 +1154,11 @@ 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 move(_Func), _Ax); } @@ -1172,7 +1188,11 @@ public: return *this; } +#if _USE_FUNCTION_INT_0_SFINAE + template &, function> = 0> +#else // ^^^ _USE_FUNCTION_INT_0_SFINAE // !_USE_FUNCTION_INT_0_SFINAE vvv template &, function>> +#endif // _USE_FUNCTION_INT_0_SFINAE function& operator=(_Fx&& _Func) { function(_STD forward<_Fx>(_Func)).swap(*this); return *this;