44 #ifndef _GLIBCXX_FUNCTIONAL
45 #define _GLIBCXX_FUNCTIONAL 1
47 #pragma GCC system_header
52 #ifdef __GXX_EXPERIMENTAL_CXX0X__
61 namespace std _GLIBCXX_VISIBILITY(default)
63 _GLIBCXX_BEGIN_NAMESPACE_VERSION
65 template<
typename _MemberPo
inter>
67 template<
typename _Tp,
typename _Class>
68 _Mem_fn<_Tp _Class::*>
74 template<
bool _Has_result_type, typename _Functor>
78 template<
typename _Functor>
80 {
typedef typename _Functor::result_type result_type; };
86 template<
typename _Functor>
92 template<
typename _Res,
typename... _ArgTypes>
94 {
typedef _Res result_type; };
96 template<
typename _Res,
typename... _ArgTypes>
98 {
typedef _Res result_type; };
100 template<
typename _Res,
typename... _ArgTypes>
101 struct _Weak_result_type_impl<_Res(_ArgTypes...) const>
102 {
typedef _Res result_type; };
104 template<
typename _Res,
typename... _ArgTypes>
105 struct _Weak_result_type_impl<_Res(_ArgTypes......) const>
106 {
typedef _Res result_type; };
108 template<
typename _Res,
typename... _ArgTypes>
109 struct _Weak_result_type_impl<_Res(_ArgTypes...) volatile>
110 {
typedef _Res result_type; };
112 template<
typename _Res,
typename... _ArgTypes>
113 struct _Weak_result_type_impl<_Res(_ArgTypes......) volatile>
114 {
typedef _Res result_type; };
116 template<
typename _Res,
typename... _ArgTypes>
117 struct _Weak_result_type_impl<_Res(_ArgTypes...) const volatile>
118 {
typedef _Res result_type; };
120 template<
typename _Res,
typename... _ArgTypes>
121 struct _Weak_result_type_impl<_Res(_ArgTypes......) const volatile>
122 {
typedef _Res result_type; };
125 template<
typename _Res,
typename... _ArgTypes>
127 {
typedef _Res result_type; };
129 template<
typename _Res,
typename... _ArgTypes>
131 {
typedef _Res result_type; };
134 template<
typename _Res,
typename... _ArgTypes>
136 {
typedef _Res result_type; };
138 template<
typename _Res,
typename... _ArgTypes>
140 {
typedef _Res result_type; };
143 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
145 {
typedef _Res result_type; };
147 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
149 {
typedef _Res result_type; };
152 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
154 {
typedef _Res result_type; };
156 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
158 {
typedef _Res result_type; };
161 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
163 {
typedef _Res result_type; };
165 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
167 {
typedef _Res result_type; };
170 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
173 {
typedef _Res result_type; };
175 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
178 {
typedef _Res result_type; };
184 template<
typename _Functor>
190 template<
typename _Tp>
194 template<
typename _T1,
typename _Res>
199 static __two __test(...);
202 static const bool value =
sizeof(__test((_Tp*)0)) == 1;
206 template<
typename _Tp>
210 template<
typename _T1,
typename _T2,
typename _Res>
215 static __two __test(...);
218 static const bool value =
sizeof(__test((_Tp*)0)) == 1;
225 template<
typename _Functor,
typename... _Args>
231 typename result_of<_Functor(_Args&&...)>::type
235 return __f(std::forward<_Args>(__args)...);
238 template<
typename _Functor,
typename... _Args>
241 (is_member_pointer<_Functor>::value
242 && !is_function<_Functor>::value
243 && !is_function<typename remove_pointer<_Functor>::type>::value),
244 typename result_of<_Functor(_Args&&...)>::type
246 __invoke(_Functor& __f, _Args&&... __args)
248 return std::mem_fn(__f)(std::forward<_Args>(__args)...);
252 template<
typename _Functor,
typename... _Args>
255 (is_pointer<_Functor>::value
256 && is_function<typename remove_pointer<_Functor>::type>::value),
257 typename result_of<_Functor(_Args&&...)>::type
259 __invoke(_Functor __f, _Args&&... __args)
261 return __f(std::forward<_Args>(__args)...);
269 template<
bool _Unary,
bool _Binary,
typename _Tp>
273 template<
typename _Tp>
279 template<
typename _Tp>
283 typedef typename _Tp::argument_type argument_type;
287 template<
typename _Tp>
288 struct _Reference_wrapper_base_impl<false, true, _Tp>
289 : _Weak_result_type<_Tp>
291 typedef typename _Tp::first_argument_type first_argument_type;
292 typedef typename _Tp::second_argument_type second_argument_type;
296 template<
typename _Tp>
297 struct _Reference_wrapper_base_impl<true, true, _Tp>
298 : _Weak_result_type<_Tp>
300 typedef typename _Tp::argument_type argument_type;
301 typedef typename _Tp::first_argument_type first_argument_type;
302 typedef typename _Tp::second_argument_type second_argument_type;
315 template<typename _Tp>
318 __has_argument_type<_Tp>::value,
319 __has_first_argument_type<_Tp>::value
320 && __has_second_argument_type<_Tp>::value,
325 template<
typename _Res,
typename _T1>
330 template<
typename _Res,
typename _T1>
331 struct _Reference_wrapper_base<_Res(_T1) const>
332 : unary_function<_T1, _Res>
335 template<
typename _Res,
typename _T1>
336 struct _Reference_wrapper_base<_Res(_T1) volatile>
337 : unary_function<_T1, _Res>
340 template<
typename _Res,
typename _T1>
341 struct _Reference_wrapper_base<_Res(_T1) const volatile>
342 : unary_function<_T1, _Res>
346 template<
typename _Res,
typename _T1,
typename _T2>
347 struct _Reference_wrapper_base<_Res(_T1, _T2)>
348 : binary_function<_T1, _T2, _Res>
351 template<
typename _Res,
typename _T1,
typename _T2>
352 struct _Reference_wrapper_base<_Res(_T1, _T2) const>
353 : binary_function<_T1, _T2, _Res>
356 template<
typename _Res,
typename _T1,
typename _T2>
357 struct _Reference_wrapper_base<_Res(_T1, _T2) volatile>
358 : binary_function<_T1, _T2, _Res>
361 template<
typename _Res,
typename _T1,
typename _T2>
362 struct _Reference_wrapper_base<_Res(_T1, _T2) const volatile>
363 : binary_function<_T1, _T2, _Res>
367 template<
typename _Res,
typename _T1>
368 struct _Reference_wrapper_base<_Res(*)(_T1)>
369 : unary_function<_T1, _Res>
373 template<
typename _Res,
typename _T1,
typename _T2>
374 struct _Reference_wrapper_base<_Res(*)(_T1, _T2)>
375 : binary_function<_T1, _T2, _Res>
379 template<
typename _Res,
typename _T1>
380 struct _Reference_wrapper_base<_Res (_T1::*)()>
381 : unary_function<_T1*, _Res>
385 template<
typename _Res,
typename _T1,
typename _T2>
386 struct _Reference_wrapper_base<_Res (_T1::*)(_T2)>
387 : binary_function<_T1*, _T2, _Res>
391 template<
typename _Res,
typename _T1>
392 struct _Reference_wrapper_base<_Res (_T1::*)() const>
393 : unary_function<const _T1*, _Res>
397 template<
typename _Res,
typename _T1,
typename _T2>
398 struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const>
399 : binary_function<const _T1*, _T2, _Res>
403 template<
typename _Res,
typename _T1>
404 struct _Reference_wrapper_base<_Res (_T1::*)() volatile>
405 : unary_function<volatile _T1*, _Res>
409 template<
typename _Res,
typename _T1,
typename _T2>
410 struct _Reference_wrapper_base<_Res (_T1::*)(_T2) volatile>
411 : binary_function<volatile _T1*, _T2, _Res>
415 template<
typename _Res,
typename _T1>
416 struct _Reference_wrapper_base<_Res (_T1::*)() const volatile>
417 : unary_function<const volatile _T1*, _Res>
421 template<
typename _Res,
typename _T1,
typename _T2>
422 struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const volatile>
423 : binary_function<const volatile _T1*, _T2, _Res>
431 template<
typename _Tp>
447 : _M_data(__inref._M_data)
453 _M_data = __inref._M_data;
457 operator _Tp&()
const noexcept
458 {
return this->
get(); }
464 template<
typename... _Args>
465 typename result_of<_Tp&(_Args&&...)>::type
466 operator()(_Args&&... __args)
const
468 return __invoke(
get(), std::forward<_Args>(__args)...);
474 template<
typename _Tp>
480 template<
typename _Tp>
481 inline reference_wrapper<const _Tp>
485 template<
typename _Tp>
486 void ref(
const _Tp&&) =
delete;
488 template<
typename _Tp>
489 void cref(
const _Tp&&) =
delete;
492 template<
typename _Tp>
493 inline reference_wrapper<_Tp>
495 {
return ref(__t.get()); }
498 template<
typename _Tp>
499 inline reference_wrapper<const _Tp>
501 {
return cref(__t.get()); }
510 template<
typename _Res,
typename... _ArgTypes>
514 template<
typename _Res,
typename _T1>
519 template<
typename _Res,
typename _T1,
typename _T2>
524 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
525 class _Mem_fn<_Res (_Class::*)(_ArgTypes...)>
528 typedef _Res (_Class::*_Functor)(_ArgTypes...);
530 template<
typename _Tp>
532 _M_call(_Tp& __object,
const volatile _Class *,
533 _ArgTypes... __args)
const
534 {
return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
536 template<
typename _Tp>
538 _M_call(_Tp& __ptr,
const volatile void *, _ArgTypes... __args)
const
539 {
return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
542 typedef _Res result_type;
544 explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
548 operator()(_Class& __object, _ArgTypes... __args)
const
549 {
return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
553 operator()(_Class* __object, _ArgTypes... __args)
const
554 {
return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
557 template<
typename _Tp>
559 operator()(_Tp& __object, _ArgTypes... __args)
const
561 return _M_call(__object, &__object,
562 std::forward<_ArgTypes>(__args)...);
570 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
571 class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const>
575 typedef _Res (_Class::*_Functor)(_ArgTypes...)
const;
577 template<
typename _Tp>
579 _M_call(_Tp& __object,
const volatile _Class *,
580 _ArgTypes... __args)
const
581 {
return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
583 template<
typename _Tp>
585 _M_call(_Tp& __ptr,
const volatile void *, _ArgTypes... __args)
const
586 {
return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
589 typedef _Res result_type;
591 explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
595 operator()(
const _Class& __object, _ArgTypes... __args)
const
596 {
return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
600 operator()(
const _Class* __object, _ArgTypes... __args)
const
601 {
return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
604 template<
typename _Tp>
605 _Res operator()(_Tp& __object, _ArgTypes... __args)
const
607 return _M_call(__object, &__object,
608 std::forward<_ArgTypes>(__args)...);
616 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
617 class _Mem_fn<_Res (_Class::*)(_ArgTypes...) volatile>
621 typedef _Res (_Class::*_Functor)(_ArgTypes...)
volatile;
623 template<
typename _Tp>
625 _M_call(_Tp& __object,
const volatile _Class *,
626 _ArgTypes... __args)
const
627 {
return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
629 template<
typename _Tp>
631 _M_call(_Tp& __ptr,
const volatile void *, _ArgTypes... __args)
const
632 {
return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
635 typedef _Res result_type;
637 explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
641 operator()(
volatile _Class& __object, _ArgTypes... __args)
const
642 {
return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
646 operator()(
volatile _Class* __object, _ArgTypes... __args)
const
647 {
return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
650 template<
typename _Tp>
652 operator()(_Tp& __object, _ArgTypes... __args)
const
654 return _M_call(__object, &__object,
655 std::forward<_ArgTypes>(__args)...);
663 template<
typename _Res,
typename _Class,
typename... _ArgTypes>
664 class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const volatile>
668 typedef _Res (_Class::*_Functor)(_ArgTypes...)
const volatile;
670 template<
typename _Tp>
672 _M_call(_Tp& __object,
const volatile _Class *,
673 _ArgTypes... __args)
const
674 {
return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
676 template<
typename _Tp>
678 _M_call(_Tp& __ptr,
const volatile void *, _ArgTypes... __args)
const
679 {
return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
682 typedef _Res result_type;
684 explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
688 operator()(
const volatile _Class& __object, _ArgTypes... __args)
const
689 {
return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
693 operator()(
const volatile _Class* __object, _ArgTypes... __args)
const
694 {
return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
697 template<
typename _Tp>
698 _Res operator()(_Tp& __object, _ArgTypes... __args)
const
700 return _M_call(__object, &__object,
701 std::forward<_ArgTypes>(__args)...);
709 template<
typename _Tp,
bool>
710 struct _Mem_fn_const_or_non
712 typedef const _Tp& type;
715 template<
typename _Tp>
716 struct _Mem_fn_const_or_non<_Tp, false>
721 template<
typename _Res,
typename _Class>
722 class _Mem_fn<_Res _Class::*>
726 template<
typename _Tp>
728 _M_call(_Tp& __object, _Class *)
const
729 {
return __object.*__pm; }
731 template<
typename _Tp,
typename _Up>
733 _M_call(_Tp& __object, _Up *
const *)
const
734 {
return (*__object).*__pm; }
736 template<
typename _Tp,
typename _Up>
738 _M_call(_Tp& __object,
const _Up *
const *)
const
739 {
return (*__object).*__pm; }
741 template<
typename _Tp>
743 _M_call(_Tp& __object,
const _Class *)
const
744 {
return __object.*__pm; }
746 template<
typename _Tp>
748 _M_call(_Tp& __ptr,
const volatile void*)
const
749 {
return (*__ptr).*__pm; }
751 template<
typename _Tp>
static _Tp& __get_ref();
753 template<
typename _Tp>
754 static __sfinae_types::__one __check_const(_Tp&, _Class*);
755 template<
typename _Tp,
typename _Up>
756 static __sfinae_types::__one __check_const(_Tp&, _Up *
const *);
757 template<
typename _Tp,
typename _Up>
758 static __sfinae_types::__two __check_const(_Tp&,
const _Up *
const *);
759 template<
typename _Tp>
760 static __sfinae_types::__two __check_const(_Tp&,
const _Class*);
761 template<
typename _Tp>
762 static __sfinae_types::__two __check_const(_Tp&,
const volatile void*);
765 template<
typename _Tp>
767 : _Mem_fn_const_or_non<_Res,
768 (sizeof(__sfinae_types::__two)
769 == sizeof(__check_const<_Tp>(__get_ref<_Tp>(), (_Tp*)0)))>
772 template<
typename _Signature>
775 template<
typename _CVMem,
typename _Tp>
776 struct result<_CVMem(_Tp)>
777 :
public _Result_type<_Tp> { };
779 template<
typename _CVMem,
typename _Tp>
780 struct result<_CVMem(_Tp&)>
781 :
public _Result_type<_Tp> { };
784 _Mem_fn(_Res _Class::*__pm) : __pm(__pm) { }
788 operator()(_Class& __object)
const
789 {
return __object.*__pm; }
792 operator()(
const _Class& __object)
const
793 {
return __object.*__pm; }
797 operator()(_Class* __object)
const
798 {
return __object->*__pm; }
801 operator()(
const _Class* __object)
const
802 {
return __object->*__pm; }
805 template<
typename _Tp>
806 typename _Result_type<_Tp>::type
807 operator()(_Tp& __unknown)
const
808 {
return _M_call(__unknown, &__unknown); }
819 template<
typename _Tp,
typename _Class>
820 inline _Mem_fn<_Tp _Class::*>
823 return _Mem_fn<_Tp _Class::*>(__pm);
832 template<
typename _Tp>
841 template<
typename _Tp>
851 _GLIBCXX_END_NAMESPACE_VERSION
857 namespace placeholders
859 _GLIBCXX_BEGIN_NAMESPACE_VERSION
893 _GLIBCXX_END_NAMESPACE_VERSION
896 _GLIBCXX_BEGIN_NAMESPACE_VERSION
917 struct _No_tuple_element;
924 template<std::
size_t __i,
typename _Tuple,
bool _IsSafe>
933 template<std::
size_t __i,
typename _Tuple>
936 typedef _No_tuple_element type;
943 template<std::
size_t __i,
typename _Tuple>
946 (__i < tuple_size<_Tuple>::value)>
960 template<typename _Arg,
961 bool _IsBindExp = is_bind_expression<_Arg>::value,
962 bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)>
969 template<typename _Tp>
970 class
_Mu<reference_wrapper<_Tp>, false, false>
973 typedef _Tp& result_type;
979 template<
typename _CVRef,
typename _Tuple>
981 operator()(_CVRef& __arg, _Tuple&)
const volatile
982 {
return __arg.get(); }
990 template<
typename _Arg>
991 class _Mu<_Arg, true, false>
994 template<
typename _CVArg,
typename... _Args>
996 operator()(_CVArg& __arg,
998 -> decltype(__arg(declval<_Args>()...))
1001 typedef typename _Build_index_tuple<
sizeof...(_Args)>::__type
1003 return this->__call(__arg, __tuple, _Indexes());
1009 template<
typename _CVArg,
typename... _Args, std::size_t... _Indexes>
1012 const _Index_tuple<_Indexes...>&)
const volatile
1013 -> decltype(__arg(declval<_Args>()...))
1015 return __arg(std::forward<_Args>(get<_Indexes>(__tuple))...);
1024 template<
typename _Arg>
1028 template<
typename _Signature>
class result;
1030 template<
typename _CVMu,
typename _CVArg,
typename _Tuple>
1031 class result<_CVMu(_CVArg, _Tuple)>
1041 typedef typename add_rvalue_reference<__base_type>::type type;
1044 template<
typename _Tuple>
1045 typename result<_Mu(_Arg, _Tuple)>::type
1046 operator()(
const volatile _Arg&, _Tuple& __tuple)
const volatile
1048 return std::forward<typename result<_Mu(_Arg, _Tuple)>::type>(
1049 ::std::get<(is_placeholder<_Arg>::value - 1)>(__tuple));
1058 template<
typename _Arg>
1062 template<
typename _Signature>
struct result;
1064 template<
typename _CVMu,
typename _CVArg,
typename _Tuple>
1065 struct result<_CVMu(_CVArg, _Tuple)>
1067 typedef typename add_lvalue_reference<_CVArg>::type type;
1071 template<
typename _CVArg,
typename _Tuple>
1073 operator()(_CVArg&& __arg, _Tuple&)
const volatile
1074 {
return std::forward<_CVArg>(__arg); }
1082 template<
typename _Tp>
1088 __do_wrap(
const _Tp& __x)
1092 __do_wrap(_Tp&& __x)
1093 {
return static_cast<_Tp&&
>(__x); }
1101 template<
typename _Tp,
typename _Class>
1104 typedef _Mem_fn<_Tp _Class::*> type;
1107 __do_wrap(_Tp _Class::* __pm)
1108 {
return type(__pm); }
1122 template<std::size_t _Ind,
typename... _Tp>
1124 __volget(
volatile tuple<_Tp...>& __tuple)
1125 ->
typename tuple_element<_Ind, tuple<_Tp...>>::type
volatile&
1126 {
return std::get<_Ind>(
const_cast<tuple<_Tp...
>&>(__tuple)); }
1129 template<std::size_t _Ind,
typename... _Tp>
1131 __volget(
const volatile tuple<_Tp...>& __tuple)
1132 ->
typename tuple_element<_Ind, tuple<_Tp...>>::type
const volatile&
1133 {
return std::get<_Ind>(
const_cast<const tuple<_Tp...
>&>(__tuple)); }
1136 template<
typename _Signature>
1139 template<
typename _Functor,
typename... _Bound_args>
1140 class _Bind<_Functor(_Bound_args...)>
1143 typedef _Bind __self_type;
1144 typedef typename _Build_index_tuple<
sizeof...(_Bound_args)>::__type
1148 tuple<_Bound_args...> _M_bound_args;
1151 template<
typename _Result,
typename... _Args, std::size_t... _Indexes>
1156 (get<_Indexes>(_M_bound_args), __args)...);
1160 template<
typename _Result,
typename... _Args, std::size_t... _Indexes>
1165 (get<_Indexes>(_M_bound_args), __args)...);
1169 template<
typename _Result,
typename... _Args, std::size_t... _Indexes>
1171 __call_v(tuple<_Args...>&& __args,
1172 _Index_tuple<_Indexes...>)
volatile
1174 return _M_f(_Mu<_Bound_args>()
1175 (__volget<_Indexes>(_M_bound_args), __args)...);
1179 template<
typename _Result,
typename... _Args, std::size_t... _Indexes>
1181 __call_c_v(tuple<_Args...>&& __args,
1182 _Index_tuple<_Indexes...>)
const volatile
1184 return _M_f(_Mu<_Bound_args>()
1185 (__volget<_Indexes>(_M_bound_args), __args)...);
1189 template<
typename... _Args>
1190 explicit _Bind(
const _Functor& __f, _Args&&... __args)
1191 : _M_f(__f), _M_bound_args(std::
forward<_Args>(__args)...)
1194 template<
typename... _Args>
1195 explicit _Bind(_Functor&& __f, _Args&&... __args)
1196 : _M_f(std::move(__f)), _M_bound_args(std::
forward<_Args>(__args)...)
1199 _Bind(
const _Bind&) =
default;
1202 : _M_f(std::move(__b._M_f)), _M_bound_args(std::move(__b._M_bound_args))
1206 template<
typename... _Args,
typename _Result
1207 = decltype( std::declval<_Functor>()(
1208 _Mu<_Bound_args>()( std::declval<_Bound_args&>(),
1211 operator()(_Args&&... __args)
1213 return this->__call<_Result>(
1214 std::forward_as_tuple(std::forward<_Args>(__args)...),
1219 template<
typename... _Args,
typename _Result
1220 = decltype(
std::declval<
typename enable_if<(
sizeof...(_Args) >= 0),
1221 typename add_const<_Functor>::type>::type>()(
1222 _Mu<_Bound_args>()( std::declval<const _Bound_args&>(),
1225 operator()(_Args&&... __args)
const
1227 return this->__call_c<_Result>(
1228 std::forward_as_tuple(std::forward<_Args>(__args)...),
1233 template<
typename... _Args,
typename _Result
1234 = decltype(
std::declval<
typename enable_if<(
sizeof...(_Args) >= 0),
1235 typename add_volatile<_Functor>::type>::type>()(
1236 _Mu<_Bound_args>()( std::declval<volatile _Bound_args&>(),
1239 operator()(_Args&&... __args)
volatile
1241 return this->__call_v<_Result>(
1242 std::forward_as_tuple(std::forward<_Args>(__args)...),
1247 template<
typename... _Args,
typename _Result
1248 = decltype(
std::declval<
typename enable_if<(
sizeof...(_Args) >= 0),
1249 typename add_cv<_Functor>::type>::type>()(
1250 _Mu<_Bound_args>()( std::declval<const volatile _Bound_args&>(),
1253 operator()(_Args&&... __args)
const volatile
1255 return this->__call_c_v<_Result>(
1256 std::forward_as_tuple(std::forward<_Args>(__args)...),
1262 template<
typename _Result,
typename _Signature>
1265 template<
typename _Result,
typename _Functor,
typename... _Bound_args>
1269 typedef typename _Build_index_tuple<
sizeof...(_Bound_args)>::__type
1273 tuple<_Bound_args...> _M_bound_args;
1276 template<
typename _Res>
1277 struct __enable_if_void :
enable_if<is_void<_Res>::value, int> { };
1278 template<
typename _Res>
1279 struct __disable_if_void :
enable_if<!is_void<_Res>::value, int> { };
1282 template<
typename _Res,
typename... _Args, std::size_t... _Indexes>
1284 __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
1285 typename __disable_if_void<_Res>::type = 0)
1287 return _M_f(_Mu<_Bound_args>()
1288 (get<_Indexes>(_M_bound_args), __args)...);
1292 template<
typename _Res,
typename... _Args, std::size_t... _Indexes>
1294 __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
1295 typename __enable_if_void<_Res>::type = 0)
1297 _M_f(_Mu<_Bound_args>()
1298 (get<_Indexes>(_M_bound_args), __args)...);
1302 template<
typename _Res,
typename... _Args, std::size_t... _Indexes>
1304 __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
1305 typename __disable_if_void<_Res>::type = 0)
const
1307 return _M_f(_Mu<_Bound_args>()
1308 (get<_Indexes>(_M_bound_args), __args)...);
1312 template<
typename _Res,
typename... _Args, std::size_t... _Indexes>
1314 __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
1315 typename __enable_if_void<_Res>::type = 0)
const
1317 _M_f(_Mu<_Bound_args>()
1318 (get<_Indexes>(_M_bound_args), __args)...);
1322 template<
typename _Res,
typename... _Args, std::size_t... _Indexes>
1324 __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
1325 typename __disable_if_void<_Res>::type = 0)
volatile
1327 return _M_f(_Mu<_Bound_args>()
1328 (__volget<_Indexes>(_M_bound_args), __args)...);
1332 template<
typename _Res,
typename... _Args, std::size_t... _Indexes>
1334 __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
1335 typename __enable_if_void<_Res>::type = 0)
volatile
1337 _M_f(_Mu<_Bound_args>()
1338 (__volget<_Indexes>(_M_bound_args), __args)...);
1342 template<
typename _Res,
typename... _Args, std::size_t... _Indexes>
1344 __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
1345 typename __disable_if_void<_Res>::type = 0)
const volatile
1347 return _M_f(_Mu<_Bound_args>()
1348 (__volget<_Indexes>(_M_bound_args), __args)...);
1352 template<
typename _Res,
typename... _Args, std::size_t... _Indexes>
1354 __call(tuple<_Args...>&& __args,
1355 _Index_tuple<_Indexes...>,
1356 typename __enable_if_void<_Res>::type = 0)
const volatile
1358 _M_f(_Mu<_Bound_args>()
1359 (__volget<_Indexes>(_M_bound_args), __args)...);
1363 typedef _Result result_type;
1365 template<
typename... _Args>
1366 explicit _Bind_result(
const _Functor& __f, _Args&&... __args)
1367 : _M_f(__f), _M_bound_args(std::
forward<_Args>(__args)...)
1370 template<
typename... _Args>
1371 explicit _Bind_result(_Functor&& __f, _Args&&... __args)
1372 : _M_f(std::move(__f)), _M_bound_args(std::
forward<_Args>(__args)...)
1375 _Bind_result(
const _Bind_result&) =
default;
1377 _Bind_result(_Bind_result&& __b)
1378 : _M_f(std::move(__b._M_f)), _M_bound_args(std::move(__b._M_bound_args))
1382 template<
typename... _Args>
1384 operator()(_Args&&... __args)
1386 return this->__call<_Result>(
1387 std::forward_as_tuple(std::forward<_Args>(__args)...),
1392 template<
typename... _Args>
1394 operator()(_Args&&... __args)
const
1396 return this->__call<_Result>(
1397 std::forward_as_tuple(std::forward<_Args>(__args)...),
1402 template<
typename... _Args>
1404 operator()(_Args&&... __args)
volatile
1406 return this->__call<_Result>(
1407 std::forward_as_tuple(std::forward<_Args>(__args)...),
1412 template<
typename... _Args>
1414 operator()(_Args&&... __args)
const volatile
1416 return this->__call<_Result>(
1417 std::forward_as_tuple(std::forward<_Args>(__args)...),
1426 template<
typename _Signature>
1434 template<
typename _Signature>
1442 template<
typename _Signature>
1450 template<
typename _Signature>
1458 template<
typename _Result,
typename _Signature>
1466 template<
typename _Result,
typename _Signature>
1474 template<
typename _Result,
typename _Signature>
1482 template<
typename _Result,
typename _Signature>
1489 template<
typename _Tp>
1490 class __is_socketlike
1492 typedef typename decay<_Tp>::type _Tp2;
1494 static const bool value =
1498 template<
bool _SocketLike,
typename _Func,
typename... _BoundArgs>
1501 typedef _Maybe_wrap_member_pointer<typename decay<_Func>::type>
1503 typedef typename __maybe_type::type __func_type;
1504 typedef _Bind<__func_type(typename decay<_BoundArgs>::type...)> type;
1510 template<
typename _Func,
typename... _BoundArgs>
1511 struct _Bind_helper<true, _Func, _BoundArgs...>
1518 template<
typename _Func,
typename... _BoundArgs>
1520 _Bind_helper<__is_socketlike<_Func>::value, _Func, _BoundArgs...>::type
1521 bind(_Func&& __f, _BoundArgs&&... __args)
1523 typedef _Bind_helper<
false, _Func, _BoundArgs...> __helper_type;
1524 typedef typename __helper_type::__maybe_type __maybe_type;
1525 typedef typename __helper_type::type __result_type;
1526 return __result_type(__maybe_type::__do_wrap(std::forward<_Func>(__f)),
1527 std::forward<_BoundArgs>(__args)...);
1530 template<
typename _Result,
typename _Func,
typename... _BoundArgs>
1531 struct _Bindres_helper
1533 typedef _Maybe_wrap_member_pointer<typename decay<_Func>::type>
1535 typedef typename __maybe_type::type __functor_type;
1536 typedef _Bind_result<_Result,
1537 __functor_type(
typename decay<_BoundArgs>::type...)>
1545 template<
typename _Result,
typename _Func,
typename... _BoundArgs>
1547 typename _Bindres_helper<_Result, _Func, _BoundArgs...>::type
1548 bind(_Func&& __f, _BoundArgs&&... __args)
1550 typedef _Bindres_helper<_Result, _Func, _BoundArgs...> __helper_type;
1551 typedef typename __helper_type::__maybe_type __maybe_type;
1552 typedef typename __helper_type::type __result_type;
1553 return __result_type(__maybe_type::__do_wrap(std::forward<_Func>(__f)),
1554 std::forward<_BoundArgs>(__args)...);
1557 template<
typename _Signature>
1558 struct _Bind_simple;
1560 template<
typename _Callable,
typename... _Args>
1561 struct _Bind_simple<_Callable(_Args...)>
1563 typedef typename result_of<_Callable(_Args...)>::type result_type;
1565 template<
typename... _Args2,
typename =
typename
1566 enable_if<
sizeof...(_Args) ==
sizeof...(_Args2)>::type>
1568 _Bind_simple(
const _Callable& __callable, _Args2&&... __args)
1569 : _M_bound(__callable, std::
forward<_Args2>(__args)...)
1572 template<
typename... _Args2,
typename =
typename
1573 enable_if<
sizeof...(_Args) ==
sizeof...(_Args2)>::type>
1575 _Bind_simple(_Callable&& __callable, _Args2&&... __args)
1576 : _M_bound(std::move(__callable), std::
forward<_Args2>(__args)...)
1579 _Bind_simple(
const _Bind_simple&) =
default;
1580 _Bind_simple(_Bind_simple&&) =
default;
1585 typedef typename _Build_index_tuple<
sizeof...(_Args)>::__type _Indices;
1586 return _M_invoke(_Indices());
1591 template<std::size_t... _Indices>
1592 typename result_of<_Callable(_Args...)>::type
1593 _M_invoke(_Index_tuple<_Indices...>)
1597 return std::forward<_Callable>(std::get<0>(_M_bound))(
1598 std::forward<_Args>(std::get<_Indices+1>(_M_bound))...);
1604 template<
typename _Func,
typename... _BoundArgs>
1605 struct _Bind_simple_helper
1607 typedef _Maybe_wrap_member_pointer<typename decay<_Func>::type>
1609 typedef typename __maybe_type::type __func_type;
1610 typedef _Bind_simple<__func_type(typename decay<_BoundArgs>::type...)>
1616 template<
typename _Callable,
typename... _Args>
1617 typename _Bind_simple_helper<_Callable, _Args...>::__type
1618 __bind_simple(_Callable&& __callable, _Args&&... __args)
1620 typedef _Bind_simple_helper<_Callable, _Args...> __helper_type;
1621 typedef typename __helper_type::__maybe_type __maybe_type;
1622 typedef typename __helper_type::__type __result_type;
1623 return __result_type(
1624 __maybe_type::__do_wrap( std::forward<_Callable>(__callable)),
1625 std::forward<_Args>(__args)...);
1644 template<
typename _Tp>
1647 || is_member_pointer<_Tp>::value)>
1650 class _Undefined_class;
1655 const void* _M_const_object;
1656 void (*_M_function_pointer)();
1657 void (_Undefined_class::*_M_member_pointer)();
1662 void* _M_access() {
return &_M_pod_data[0]; }
1663 const void* _M_access()
const {
return &_M_pod_data[0]; }
1665 template<
typename _Tp>
1668 {
return *
static_cast<_Tp*
>(_M_access()); }
1670 template<
typename _Tp>
1673 {
return *
static_cast<const _Tp*
>(_M_access()); }
1675 _Nocopy_types _M_unused;
1676 char _M_pod_data[
sizeof(_Nocopy_types)];
1679 enum _Manager_operation
1689 template<
typename _Tp>
1690 struct _Simple_type_wrapper
1692 _Simple_type_wrapper(_Tp __value) : __value(__value) { }
1697 template<
typename _Tp>
1698 struct __is_location_invariant<_Simple_type_wrapper<_Tp> >
1699 : __is_location_invariant<_Tp>
1704 template<
typename _Functor>
1706 __callable_functor(_Functor& __f)
1709 template<
typename _Member,
typename _Class>
1710 inline _Mem_fn<_Member _Class::*>
1711 __callable_functor(_Member _Class::* &__p)
1714 template<
typename _Member,
typename _Class>
1715 inline _Mem_fn<_Member _Class::*>
1716 __callable_functor(_Member _Class::*
const &__p)
1719 template<
typename _Signature>
1726 static const std::size_t _M_max_size =
sizeof(_Nocopy_types);
1727 static const std::size_t _M_max_align = __alignof__(_Nocopy_types);
1729 template<
typename _Functor>
1733 static const bool __stored_locally =
1735 &&
sizeof(_Functor) <= _M_max_size
1736 && __alignof__(_Functor) <= _M_max_align
1737 && (_M_max_align % __alignof__(_Functor) == 0));
1743 _M_get_pointer(
const _Any_data& __source)
1745 const _Functor* __ptr =
1747 : __source._M_access<_Functor*>();
1748 return const_cast<_Functor*
>(__ptr);
1754 _M_clone(_Any_data& __dest,
const _Any_data& __source,
true_type)
1756 new (__dest._M_access()) _Functor(__source._M_access<_Functor>());
1762 _M_clone(_Any_data& __dest,
const _Any_data& __source,
false_type)
1764 __dest._M_access<_Functor*>() =
1765 new _Functor(*__source._M_access<_Functor*>());
1771 _M_destroy(_Any_data& __victim,
true_type)
1773 __victim._M_access<_Functor>().~_Functor();
1780 delete __victim._M_access<_Functor*>();
1785 _M_manager(_Any_data& __dest,
const _Any_data& __source,
1786 _Manager_operation __op)
1791 case __get_type_info:
1792 __dest._M_access<
const type_info*>() = &
typeid(_Functor);
1795 case __get_functor_ptr:
1796 __dest._M_access<_Functor*>() = _M_get_pointer(__source);
1799 case __clone_functor:
1800 _M_clone(__dest, __source, _Local_storage());
1803 case __destroy_functor:
1804 _M_destroy(__dest, _Local_storage());
1811 _M_init_functor(_Any_data& __functor, _Functor&& __f)
1812 { _M_init_functor(__functor, std::move(__f), _Local_storage()); }
1814 template<
typename _Signature>
1816 _M_not_empty_function(
const function<_Signature>& __f)
1817 {
return static_cast<bool>(__f); }
1819 template<
typename _Tp>
1821 _M_not_empty_function(
const _Tp*& __fp)
1824 template<
typename _Class,
typename _Tp>
1826 _M_not_empty_function(_Tp _Class::*
const& __mp)
1829 template<
typename _Tp>
1831 _M_not_empty_function(
const _Tp&)
1836 _M_init_functor(_Any_data& __functor, _Functor&& __f,
true_type)
1837 {
new (__functor._M_access()) _Functor(std::move(__f)); }
1840 _M_init_functor(_Any_data& __functor, _Functor&& __f,
false_type)
1841 { __functor._M_access<_Functor*>() =
new _Functor(std::move(__f)); }
1844 template<
typename _Functor>
1845 class _Ref_manager :
public _Base_manager<_Functor*>
1847 typedef _Function_base::_Base_manager<_Functor*> _Base;
1851 _M_manager(_Any_data& __dest,
const _Any_data& __source,
1852 _Manager_operation __op)
1857 case __get_type_info:
1858 __dest._M_access<
const type_info*>() = &
typeid(_Functor);
1861 case __get_functor_ptr:
1862 __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
1867 _Base::_M_manager(__dest, __source, __op);
1884 _M_manager(_M_functor, _M_functor, __destroy_functor);
1888 bool _M_empty()
const {
return !_M_manager; }
1890 typedef bool (*_Manager_type)(_Any_data&,
const _Any_data&,
1891 _Manager_operation);
1893 _Any_data _M_functor;
1894 _Manager_type _M_manager;
1897 template<
typename _Signature,
typename _Functor>
1898 class _Function_handler;
1900 template<
typename _Res,
typename _Functor,
typename... _ArgTypes>
1901 class _Function_handler<_Res(_ArgTypes...), _Functor>
1902 :
public _Function_base::_Base_manager<_Functor>
1904 typedef _Function_base::_Base_manager<_Functor> _Base;
1908 _M_invoke(
const _Any_data& __functor, _ArgTypes... __args)
1910 return (*_Base::_M_get_pointer(__functor))(
1911 std::forward<_ArgTypes>(__args)...);
1915 template<
typename _Functor,
typename... _ArgTypes>
1916 class _Function_handler<void(_ArgTypes...), _Functor>
1917 :
public _Function_base::_Base_manager<_Functor>
1919 typedef _Function_base::_Base_manager<_Functor> _Base;
1923 _M_invoke(
const _Any_data& __functor, _ArgTypes... __args)
1925 (*_Base::_M_get_pointer(__functor))(
1926 std::forward<_ArgTypes>(__args)...);
1930 template<
typename _Res,
typename _Functor,
typename... _ArgTypes>
1931 class _Function_handler<_Res(_ArgTypes...), reference_wrapper<_Functor> >
1932 :
public _Function_base::_Ref_manager<_Functor>
1934 typedef _Function_base::_Ref_manager<_Functor> _Base;
1938 _M_invoke(
const _Any_data& __functor, _ArgTypes... __args)
1940 return __callable_functor(**_Base::_M_get_pointer(__functor))(
1941 std::forward<_ArgTypes>(__args)...);
1945 template<
typename _Functor,
typename... _ArgTypes>
1946 class _Function_handler<void(_ArgTypes...), reference_wrapper<_Functor> >
1947 :
public _Function_base::_Ref_manager<_Functor>
1949 typedef _Function_base::_Ref_manager<_Functor> _Base;
1953 _M_invoke(
const _Any_data& __functor, _ArgTypes... __args)
1955 __callable_functor(**_Base::_M_get_pointer(__functor))(
1956 std::forward<_ArgTypes>(__args)...);
1960 template<
typename _Class,
typename _Member,
typename _Res,
1961 typename... _ArgTypes>
1962 class _Function_handler<_Res(_ArgTypes...), _Member _Class::*>
1963 :
public _Function_handler<void(_ArgTypes...), _Member _Class::*>
1965 typedef _Function_handler<void(_ArgTypes...), _Member _Class::*>
1970 _M_invoke(
const _Any_data& __functor, _ArgTypes... __args)
1972 return std::mem_fn(_Base::_M_get_pointer(__functor)->__value)(
1973 std::forward<_ArgTypes>(__args)...);
1977 template<
typename _Class,
typename _Member,
typename... _ArgTypes>
1978 class _Function_handler<void(_ArgTypes...), _Member _Class::*>
1979 :
public _Function_base::_Base_manager<
1980 _Simple_type_wrapper< _Member _Class::* > >
1982 typedef _Member _Class::* _Functor;
1983 typedef _Simple_type_wrapper<_Functor> _Wrapper;
1984 typedef _Function_base::_Base_manager<_Wrapper> _Base;
1988 _M_manager(_Any_data& __dest,
const _Any_data& __source,
1989 _Manager_operation __op)
1994 case __get_type_info:
1995 __dest._M_access<
const type_info*>() = &
typeid(_Functor);
1998 case __get_functor_ptr:
1999 __dest._M_access<_Functor*>() =
2000 &_Base::_M_get_pointer(__source)->__value;
2004 _Base::_M_manager(__dest, __source, __op);
2010 _M_invoke(
const _Any_data& __functor, _ArgTypes... __args)
2012 std::mem_fn(_Base::_M_get_pointer(__functor)->__value)(
2013 std::forward<_ArgTypes>(__args)...);
2023 template<
typename _Res,
typename... _ArgTypes>
2024 class function<_Res(_ArgTypes...)>
2028 typedef _Res _Signature_type(_ArgTypes...);
2030 struct _Useless { };
2033 typedef _Res result_type;
2048 function(nullptr_t) noexcept
2059 function(
const function& __x);
2091 template<
typename _Functor>
2092 function(_Functor __f,
2112 function(__x).swap(*
this);
2130 function(std::move(__x)).swap(*
this);
2146 _M_manager(_M_functor, _M_functor, __destroy_functor);
2169 template<
typename _Functor>
2173 function(std::forward<_Functor>(__f)).swap(*
this);
2178 template<
typename _Functor>
2182 function(__f).swap(*
this);
2197 std::swap(_M_functor, __x._M_functor);
2198 std::swap(_M_manager, __x._M_manager);
2199 std::swap(_M_invoker, __x._M_invoker);
2223 explicit operator bool() const noexcept
2224 {
return !_M_empty(); }
2236 _Res operator()(_ArgTypes... __args)
const;
2249 const type_info& target_type() const noexcept;
2260 template<typename _Functor> _Functor* target() noexcept;
2263 template<typename _Functor> const _Functor* target() const noexcept;
2267 typedef _Res (*_Invoker_type)(
const _Any_data&, _ArgTypes...);
2268 _Invoker_type _M_invoker;
2272 template<
typename _Res,
typename... _ArgTypes>
2273 function<_Res(_ArgTypes...)>::
2274 function(
const function& __x)
2277 if (static_cast<bool>(__x))
2279 _M_invoker = __x._M_invoker;
2280 _M_manager = __x._M_manager;
2281 __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
2285 template<
typename _Res,
typename... _ArgTypes>
2286 template<
typename _Functor>
2287 function<_Res(_ArgTypes...)>::
2288 function(_Functor __f,
2293 typedef _Function_handler<_Signature_type, _Functor> _My_handler;
2295 if (_My_handler::_M_not_empty_function(__f))
2297 _My_handler::_M_init_functor(_M_functor, std::move(__f));
2298 _M_invoker = &_My_handler::_M_invoke;
2299 _M_manager = &_My_handler::_M_manager;
2303 template<
typename _Res,
typename... _ArgTypes>
2305 function<_Res(_ArgTypes...)>::
2306 operator()(_ArgTypes... __args)
const
2309 __throw_bad_function_call();
2310 return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
2314 template<
typename _Res,
typename... _ArgTypes>
2316 function<_Res(_ArgTypes...)>::
2317 target_type() const noexcept
2321 _Any_data __typeinfo_result;
2322 _M_manager(__typeinfo_result, _M_functor, __get_type_info);
2323 return *__typeinfo_result._M_access<
const type_info*>();
2326 return typeid(void);
2329 template<
typename _Res,
typename... _ArgTypes>
2330 template<
typename _Functor>
2332 function<_Res(_ArgTypes...)>::
2335 if (
typeid(_Functor) == target_type() && _M_manager)
2338 if (_M_manager(__ptr, _M_functor, __get_functor_ptr)
2342 return __ptr._M_access<_Functor*>();
2348 template<
typename _Res,
typename... _ArgTypes>
2349 template<
typename _Functor>
2351 function<_Res(_ArgTypes...)>::
2352 target() const noexcept
2354 if (
typeid(_Functor) == target_type() && _M_manager)
2357 _M_manager(__ptr, _M_functor, __get_functor_ptr);
2358 return __ptr._M_access<
const _Functor*>();
2374 template<
typename _Res,
typename... _Args>
2376 operator==(
const function<_Res(_Args...)>& __f, nullptr_t) noexcept
2377 {
return !
static_cast<bool>(__f); }
2380 template<
typename _Res,
typename... _Args>
2382 operator==(nullptr_t,
const function<_Res(_Args...)>& __f) noexcept
2383 {
return !
static_cast<bool>(__f); }
2392 template<
typename _Res,
typename... _Args>
2394 operator!=(
const function<_Res(_Args...)>& __f, nullptr_t) noexcept
2395 {
return static_cast<bool>(__f); }
2398 template<
typename _Res,
typename... _Args>
2400 operator!=(nullptr_t,
const function<_Res(_Args...)>& __f) noexcept
2401 {
return static_cast<bool>(__f); }
2410 template<
typename _Res,
typename... _Args>
2412 swap(
function<_Res(_Args...)>& __x,
function<_Res(_Args...)>& __y)
2415 _GLIBCXX_END_NAMESPACE_VERSION
2418 #endif // __GXX_EXPERIMENTAL_CXX0X__
2420 #endif // _GLIBCXX_FUNCTIONAL
void swap(function &__x)
Swap the targets of two function objects.
The type of placeholder objects defined by libstdc++.
function & operator=(const function &__x)
Function assignment operator.
Determines if the type _Tp derives from binary_function.
Primary class template, tuple.
enable_if< (!is_member_pointer< _Functor >::value &&!is_function< _Functor >::value &&!is_function< typename remove_pointer< _Functor >::type >::value), typename result_of< _Functor(_Args &&...)>::type >::type __invoke(_Functor &__f, _Args &&...__args)
Exception class thrown when class template function's operator() is called with an empty target...
reference_wrapper< const _Tp > cref(const _Tp &__t) noexcept
Denotes a const reference should be taken to a variable.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
function & operator=(nullptr_t)
Function assignment to zero.
#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE)
reference_wrapper< _Tp > ref(_Tp &__t) noexcept
Denotes a reference should be taken to a variable.
Define a member typedef type only if a boolean constant is true.
_Bind_helper< __is_socketlike< _Func >::value, _Func, _BoundArgs...>::type bind(_Func &&__f, _BoundArgs &&...__args)
Function template for std::bind.
enable_if<!is_integral< _Functor >::value, function & >::type operator=(_Functor &&__f)
Function assignment to a new target.
Type of the function object returned from bind().
Base class of all polymorphic function object wrappers.
Determines if the given type _Tp is a function object should be treated as a subexpression when evalu...
If we have found a result_type, extract it.
Primary class template for reference_wrapper.
Base class for all library exceptions.
Type of the function object returned from bind<R>().
_Mem_fn< _Tp _Class::* > mem_fn(_Tp _Class::*)
Returns a function object that forwards to the member pointer pm.
function & operator=(function &&__x)
Function move-assignment operator.
add_rvalue_reference< _Tp >::type declval() noexcept
Utility to simplify expressions used in unevaluated operands.
_Tp * __addressof(_Tp &__r) _GLIBCXX_NOEXCEPT
Same as C++11 std::addressof.
Determines if the type _Tp derives from unary_function.
Determines if the given type _Tp is a placeholder in a bind() expression and, if so, which placeholder it is. [TR1 3.6.2].
enable_if<!is_integral< _Functor >::value, function & >::type operator=(reference_wrapper< _Functor > __f) noexcept