diff --git a/include/__functional_base_03 b/include/__functional_base_03 index e2f0e3e7..0a7ff62e 100644 --- a/include/__functional_base_03 +++ b/include/__functional_base_03 @@ -408,20 +408,15 @@ template inline _LIBCPP_INLINE_VISIBILITY typename enable_if < + is_member_object_pointer<_Rp _Tp::*>::value && is_base_of<_Tp, typename remove_reference<_T1>::type>::value, - typename __apply_cv<_T1, _Rp>::type& ->::type + __apply_cv<_T1, _Rp> +>::type::type& __invoke(_Rp _Tp::* __f, _T1& __t1) { return __t1.*__f; } -template -inline _LIBCPP_INLINE_VISIBILITY -void -__invoke(_Rp _Tp::*) -{ -} // forth bullet @@ -439,10 +434,9 @@ struct __4th_helper<_T1, _Rp, true> template inline _LIBCPP_INLINE_VISIBILITY typename __4th_helper<_T1, _Rp, - !is_base_of<_Tp, - typename remove_reference<_T1>::type - >::value - >::type& + is_member_object_pointer<_Rp _Tp::*>::value && + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value +>::type& __invoke(_Rp _Tp::* __f, _T1& __t1) { return (*__t1).*__f; @@ -494,20 +488,20 @@ struct __invoke_return<_Fp, false> typedef decltype(__invoke(_VSTD::declval<_Fp&>())) type; }; -template +template ::value> struct __invoke_return0 { typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>())) type; }; template -struct __invoke_return0<_Rp _Tp::*, _A0> +struct __invoke_return0<_Rp _Tp::*, _A0, true> { typedef typename __apply_cv<_A0, _Rp>::type& type; }; template -struct __invoke_return0<_Rp _Tp::*, _A0*> +struct __invoke_return0<_Rp _Tp::*, _A0*, true> { typedef typename __apply_cv<_A0, _Rp>::type& type; }; diff --git a/include/functional b/include/functional index 939486ff..6c57de03 100644 --- a/include/functional +++ b/include/functional @@ -1260,10 +1260,6 @@ public: return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...); } #else - typename __invoke_return::type - operator() () const { - return __invoke(__f_); - } template typename __invoke_return0::type