aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libstdc++-v3/include/std/functional
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/libstdc++-v3/include/std/functional')
-rw-r--r--gcc-4.9/libstdc++-v3/include/std/functional11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc-4.9/libstdc++-v3/include/std/functional b/gcc-4.9/libstdc++-v3/include/std/functional
index 5a987d914..0e80fa37c 100644
--- a/gcc-4.9/libstdc++-v3/include/std/functional
+++ b/gcc-4.9/libstdc++-v3/include/std/functional
@@ -2149,8 +2149,15 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
using _Invoke = decltype(__callable_functor(std::declval<_Functor&>())
(std::declval<_ArgTypes>()...) );
+ // Used so the return type convertibility checks aren't done when
+ // performing overload resolution for copy construction/assignment.
+ template<typename _Tp>
+ using _NotSelf = __not_<is_same<_Tp, function>>;
+
template<typename _Functor>
- using _Callable = __check_func_return_type<_Invoke<_Functor>, _Res>;
+ using _Callable
+ = __and_<_NotSelf<_Functor>,
+ __check_func_return_type<_Invoke<_Functor>, _Res>>;
template<typename _Cond, typename _Tp>
using _Requires = typename enable_if<_Cond::value, _Tp>::type;
@@ -2291,7 +2298,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* reference_wrapper<F>, this function will not throw.
*/
template<typename _Functor>
- _Requires<_Callable<_Functor>, function&>
+ _Requires<_Callable<typename decay<_Functor>::type>, function&>
operator=(_Functor&& __f)
{
function(std::forward<_Functor>(__f)).swap(*this);