|
@@ -281,169 +281,55 @@ struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const volatile>
|
|
|
|
|
|
// __invoke
|
|
|
|
|
|
-// first bullet
|
|
|
+// bullets 1 and 2
|
|
|
|
|
|
-template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
|
|
+template <class _F, class _A0, class ..._Args>
|
|
|
inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- sizeof...(_Param) == sizeof...(_Arg) &&
|
|
|
- is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
|
|
- _R
|
|
|
->::type
|
|
|
-__invoke(_R (_T::*__f)(_Param...), _T1&& __t1, _Arg&& ...__arg)
|
|
|
-{
|
|
|
- return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
|
|
-}
|
|
|
-
|
|
|
-template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
|
|
-inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- sizeof...(_Param) == sizeof...(_Arg) &&
|
|
|
- is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
|
|
- _R
|
|
|
->::type
|
|
|
-__invoke(_R (_T::*__f)(_Param...) const, _T1&& __t1, _Arg&& ...__arg)
|
|
|
-{
|
|
|
- return (_STD::forward<const _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
|
|
-}
|
|
|
-
|
|
|
-template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
|
|
-inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- sizeof...(_Param) == sizeof...(_Arg) &&
|
|
|
- is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
|
|
- _R
|
|
|
->::type
|
|
|
-__invoke(_R (_T::*__f)(_Param...) volatile, _T1&& __t1, _Arg&& ...__arg)
|
|
|
-{
|
|
|
- return (_STD::forward<volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
|
|
-}
|
|
|
-
|
|
|
-template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
|
|
-inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- sizeof...(_Param) == sizeof...(_Arg) &&
|
|
|
- is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
|
|
- _R
|
|
|
->::type
|
|
|
-__invoke(_R (_T::*__f)(_Param...) const volatile, _T1&& __t1, _Arg&& ...__arg)
|
|
|
-{
|
|
|
- return (_STD::forward<const volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
|
|
-}
|
|
|
-
|
|
|
-// second bullet
|
|
|
-
|
|
|
-template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
|
|
-inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- sizeof...(_Param) == sizeof...(_Arg) &&
|
|
|
- !is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
|
|
- _R
|
|
|
->::type
|
|
|
-__invoke(_R (_T::*__f)(_Param...), _T1&& __t1, _Arg&& ...__arg)
|
|
|
-{
|
|
|
- return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
|
|
-}
|
|
|
-
|
|
|
-template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
|
|
-inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- sizeof...(_Param) == sizeof...(_Arg) &&
|
|
|
- !is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
|
|
- _R
|
|
|
->::type
|
|
|
-__invoke(_R (_T::*__f)(_Param...) const, _T1&& __t1, _Arg&& ...__arg)
|
|
|
-{
|
|
|
- return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
|
|
-}
|
|
|
-
|
|
|
-template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
|
|
-inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- sizeof...(_Param) == sizeof...(_Arg) &&
|
|
|
- !is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
|
|
- _R
|
|
|
->::type
|
|
|
-__invoke(_R (_T::*__f)(_Param...) volatile, _T1&& __t1, _Arg&& ...__arg)
|
|
|
-{
|
|
|
- return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
|
|
+auto
|
|
|
+__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
|
|
+ -> decltype((_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...))
|
|
|
+{
|
|
|
+ return (_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...);
|
|
|
}
|
|
|
|
|
|
-template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
|
|
+template <class _F, class _A0, class ..._Args>
|
|
|
inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- sizeof...(_Param) == sizeof...(_Arg) &&
|
|
|
- !is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
|
|
- _R
|
|
|
->::type
|
|
|
-__invoke(_R (_T::*__f)(_Param...) const volatile, _T1&& __t1, _Arg&& ...__arg)
|
|
|
-{
|
|
|
- return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
|
|
+auto
|
|
|
+__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
|
|
+ -> decltype(((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...))
|
|
|
+{
|
|
|
+ return ((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...);
|
|
|
}
|
|
|
|
|
|
-// third bullet
|
|
|
+// bullets 3 and 4
|
|
|
|
|
|
-template <class _R, class _T, class _T1>
|
|
|
+template <class _F, class _A0>
|
|
|
inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
|
|
- typename __apply_cv<_T1, _R>::type&&
|
|
|
->::type
|
|
|
-__invoke(_R _T::* __f, _T1&& __t1)
|
|
|
-{
|
|
|
- return _STD::forward<_T1>(__t1).*__f;
|
|
|
-}
|
|
|
-
|
|
|
-// forth bullet
|
|
|
-
|
|
|
-template <class _T1, class _R, bool>
|
|
|
-struct __4th_helper
|
|
|
+auto
|
|
|
+__invoke(_F&& __f, _A0&& __a0)
|
|
|
+ -> decltype(_STD::forward<_A0>(__a0).*__f)
|
|
|
{
|
|
|
-};
|
|
|
-
|
|
|
-template <class _T1, class _R>
|
|
|
-struct __4th_helper<_T1, _R, true>
|
|
|
-{
|
|
|
- typedef typename __apply_cv<decltype(*_STD::declval<_T1>()), _R>::type type;
|
|
|
-};
|
|
|
-
|
|
|
-template <class _R, class _T, class _T1>
|
|
|
-inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename __4th_helper<_T1, _R,
|
|
|
- !is_base_of<_T,
|
|
|
- typename remove_reference<_T1>::type
|
|
|
- >::value
|
|
|
- >::type&&
|
|
|
-__invoke(_R _T::* __f, _T1&& __t1)
|
|
|
-{
|
|
|
- return (*_STD::forward<_T1>(__t1)).*__f;
|
|
|
+ return _STD::forward<_A0>(__a0).*__f;
|
|
|
}
|
|
|
|
|
|
-// fifth bullet
|
|
|
-
|
|
|
-template <class _R, class ..._Param, class ..._Args>
|
|
|
+template <class _F, class _A0>
|
|
|
inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-_R
|
|
|
-__invoke(_R (*__f)(_Param...), _Args&& ...__args)
|
|
|
+auto
|
|
|
+__invoke(_F&& __f, _A0&& __a0)
|
|
|
+ -> decltype((*_STD::forward<_A0>(__a0)).*__f)
|
|
|
{
|
|
|
- return __f(_STD::forward<_Args>(__args)...);
|
|
|
+ return (*_STD::forward<_A0>(__a0)).*__f;
|
|
|
}
|
|
|
|
|
|
-template <class _F, class ..._T>
|
|
|
+// bullet 5
|
|
|
+
|
|
|
+template <class _F, class ..._Args>
|
|
|
inline _LIBCPP_INLINE_VISIBILITY
|
|
|
-typename __invoke_of<_F, _T...>::type
|
|
|
-__invoke(_F&& __f, _T&& ...__t)
|
|
|
+auto
|
|
|
+__invoke(_F&& __f, _Args&& ...__args)
|
|
|
+ -> decltype(_STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...))
|
|
|
{
|
|
|
- return _STD::forward<_F>(__f)(_STD::forward<_T>(__t)...);
|
|
|
+ return _STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...);
|
|
|
}
|
|
|
|
|
|
template <class _Tp, class ..._Args>
|