diff --git a/stl/inc/functional b/stl/inc/functional index 05df5e7de6..5038e78c9b 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -886,9 +886,9 @@ public: protected: template - using _Enable_if_callable_t = - enable_if_t, _Function>>, _Is_invocable_r<_Ret, _Fx, _Types...>>, - int>; + using _Enable_if_callable_t = enable_if_t, _Function>>, + _Is_invocable_r<_Ret, decay_t<_Fx>&, _Types...>>, + int>; bool _Empty() const noexcept { return !_Getimpl(); @@ -1045,12 +1045,12 @@ public: } #if _USE_FUNCTION_INT_0_SFINAE - template = 0> + template = 0> #else // ^^^ _USE_FUNCTION_INT_0_SFINAE // !_USE_FUNCTION_INT_0_SFINAE vvv - template > + template > #endif // _USE_FUNCTION_INT_0_SFINAE - function(_Fx _Func) { - this->_Reset(_STD move(_Func)); + function(_Fx&& _Func) { + this->_Reset(_STD forward<_Fx>(_Func)); } #if _HAS_FUNCTION_ALLOCATOR_SUPPORT @@ -1066,12 +1066,12 @@ public: } #if _USE_FUNCTION_INT_0_SFINAE - template = 0> + template = 0> #else // ^^^ _USE_FUNCTION_INT_0_SFINAE // !_USE_FUNCTION_INT_0_SFINAE vvv - template > + template > #endif // _USE_FUNCTION_INT_0_SFINAE - function(allocator_arg_t, const _Alloc& _Ax, _Fx _Func) { - this->_Reset_alloc(_STD move(_Func), _Ax); + function(allocator_arg_t, const _Alloc& _Ax, _Fx&& _Func) { + this->_Reset_alloc(_STD forward<_Fx>(_Func), _Ax); } #endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT @@ -1100,9 +1100,9 @@ public: } #if _USE_FUNCTION_INT_0_SFINAE - template &, function> = 0> + template = 0> #else // ^^^ _USE_FUNCTION_INT_0_SFINAE // !_USE_FUNCTION_INT_0_SFINAE vvv - template &, function>> + template > #endif // _USE_FUNCTION_INT_0_SFINAE function& operator=(_Fx&& _Func) { function(_STD forward<_Fx>(_Func)).swap(*this);