29 #ifndef _GLIBCXX_TYPE_TRAITS
30 #define _GLIBCXX_TYPE_TRAITS 1
32 #pragma GCC system_header
34 #if __cplusplus < 201103L
40 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
41 # if defined (__UINT_LEAST16_TYPE__) && defined(__UINT_LEAST32_TYPE__)
44 typedef __UINT_LEAST16_TYPE__ uint_least16_t;
45 typedef __UINT_LEAST32_TYPE__ uint_least32_t;
52 namespace std _GLIBCXX_VISIBILITY(default)
54 _GLIBCXX_BEGIN_NAMESPACE_VERSION
68 template<
typename _Tp, _Tp __v>
71 static constexpr _Tp value = __v;
72 typedef _Tp value_type;
74 constexpr
operator value_type()
const {
return value; }
75 #if __cplusplus > 201103L
76 constexpr value_type operator()()
const {
return value; }
80 template<
typename _Tp, _Tp __v>
91 template<
bool,
typename,
typename>
102 template<
typename _B1>
107 template<
typename _B1,
typename _B2>
108 struct __or_<_B1, _B2>
109 :
public conditional<_B1::value, _B1, _B2>::type
112 template<
typename _B1,
typename _B2,
typename _B3,
typename... _Bn>
113 struct __or_<_B1, _B2, _B3, _Bn...>
114 :
public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
117 template<
typename...>
125 template<
typename _B1>
130 template<
typename _B1,
typename _B2>
131 struct __and_<_B1, _B2>
132 :
public conditional<_B1::value, _B2, _B1>::type
135 template<
typename _B1,
typename _B2,
typename _B3,
typename... _Bn>
136 struct __and_<_B1, _B2, _B3, _Bn...>
137 :
public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
140 template<
typename _Pp>
142 :
public integral_constant<bool, !_Pp::value>
150 template<
typename _Tp>
151 struct __success_type
152 {
typedef _Tp type; };
154 struct __failure_type
163 struct __is_void_helper
167 struct __is_void_helper<void>
171 template<
typename _Tp>
173 :
public __is_void_helper<typename remove_cv<_Tp>::type>
::type
177 struct __is_integral_helper
181 struct __is_integral_helper<bool>
185 struct __is_integral_helper<char>
189 struct __is_integral_helper<signed char>
193 struct __is_integral_helper<unsigned char>
196 #ifdef _GLIBCXX_USE_WCHAR_T
198 struct __is_integral_helper<wchar_t>
203 struct __is_integral_helper<char16_t>
207 struct __is_integral_helper<char32_t>
211 struct __is_integral_helper<short>
215 struct __is_integral_helper<unsigned short>
219 struct __is_integral_helper<int>
223 struct __is_integral_helper<unsigned int>
227 struct __is_integral_helper<long>
231 struct __is_integral_helper<unsigned long>
235 struct __is_integral_helper<long long>
239 struct __is_integral_helper<unsigned long long>
242 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
244 struct __is_integral_helper<__int128>
248 struct __is_integral_helper<unsigned __int128>
253 template<
typename _Tp>
255 :
public __is_integral_helper<typename remove_cv<_Tp>::type>
::type
259 struct __is_floating_point_helper
263 struct __is_floating_point_helper<float>
267 struct __is_floating_point_helper<double>
271 struct __is_floating_point_helper<long double>
274 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
276 struct __is_floating_point_helper<__float128>
281 template<
typename _Tp>
283 :
public __is_floating_point_helper<typename remove_cv<_Tp>::type>::type
291 template<
typename _Tp, std::
size_t _Size>
295 template<
typename _Tp>
296 struct is_array<_Tp[]>
300 struct __is_pointer_helper
303 template<
typename _Tp>
304 struct __is_pointer_helper<_Tp*>
308 template<
typename _Tp>
310 :
public __is_pointer_helper<typename remove_cv<_Tp>::type>::type
318 template<
typename _Tp>
327 template<
typename _Tp>
335 struct __is_member_object_pointer_helper
338 template<
typename _Tp,
typename _Cp>
339 struct __is_member_object_pointer_helper<_Tp _Cp::*>
343 template<
typename _Tp>
345 :
public __is_member_object_pointer_helper<
346 typename remove_cv<_Tp>::type>::type
350 struct __is_member_function_pointer_helper
353 template<
typename _Tp,
typename _Cp>
354 struct __is_member_function_pointer_helper<_Tp _Cp::*>
355 :
public integral_constant<bool, is_function<_Tp>::value> { };
358 template<
typename _Tp>
360 :
public __is_member_function_pointer_helper<
361 typename remove_cv<_Tp>::type>
::type
365 template<
typename _Tp>
371 template<
typename _Tp>
377 template<
typename _Tp>
387 template<
typename _Res,
typename... _ArgTypes>
388 struct is_function<_Res(_ArgTypes...)>
391 template<
typename _Res,
typename... _ArgTypes>
392 struct is_function<_Res(_ArgTypes...) &>
395 template<
typename _Res,
typename... _ArgTypes>
396 struct is_function<_Res(_ArgTypes...) &&>
399 template<
typename _Res,
typename... _ArgTypes>
400 struct is_function<_Res(_ArgTypes......)>
403 template<
typename _Res,
typename... _ArgTypes>
404 struct is_function<_Res(_ArgTypes......) &>
407 template<
typename _Res,
typename... _ArgTypes>
408 struct is_function<_Res(_ArgTypes......) &&>
411 template<
typename _Res,
typename... _ArgTypes>
412 struct is_function<_Res(_ArgTypes...) const>
415 template<
typename _Res,
typename... _ArgTypes>
416 struct is_function<_Res(_ArgTypes...) const &>
419 template<
typename _Res,
typename... _ArgTypes>
420 struct is_function<_Res(_ArgTypes...) const &&>
423 template<
typename _Res,
typename... _ArgTypes>
424 struct is_function<_Res(_ArgTypes......) const>
427 template<
typename _Res,
typename... _ArgTypes>
428 struct is_function<_Res(_ArgTypes......) const &>
431 template<
typename _Res,
typename... _ArgTypes>
432 struct is_function<_Res(_ArgTypes......) const &&>
435 template<
typename _Res,
typename... _ArgTypes>
436 struct is_function<_Res(_ArgTypes...) volatile>
439 template<
typename _Res,
typename... _ArgTypes>
440 struct is_function<_Res(_ArgTypes...) volatile &>
443 template<
typename _Res,
typename... _ArgTypes>
444 struct is_function<_Res(_ArgTypes...) volatile &&>
447 template<
typename _Res,
typename... _ArgTypes>
448 struct is_function<_Res(_ArgTypes......) volatile>
451 template<
typename _Res,
typename... _ArgTypes>
452 struct is_function<_Res(_ArgTypes......) volatile &>
455 template<
typename _Res,
typename... _ArgTypes>
456 struct is_function<_Res(_ArgTypes......) volatile &&>
459 template<
typename _Res,
typename... _ArgTypes>
460 struct is_function<_Res(_ArgTypes...) const volatile>
463 template<
typename _Res,
typename... _ArgTypes>
464 struct is_function<_Res(_ArgTypes...) const volatile &>
467 template<
typename _Res,
typename... _ArgTypes>
468 struct is_function<_Res(_ArgTypes...) const volatile &&>
471 template<
typename _Res,
typename... _ArgTypes>
472 struct is_function<_Res(_ArgTypes......) const volatile>
475 template<
typename _Res,
typename... _ArgTypes>
476 struct is_function<_Res(_ArgTypes......) const volatile &>
479 template<
typename _Res,
typename... _ArgTypes>
480 struct is_function<_Res(_ArgTypes......) const volatile &&>
484 struct __is_null_pointer_helper
488 struct __is_null_pointer_helper<std::nullptr_t>
492 template<
typename _Tp>
494 :
public __is_null_pointer_helper<typename remove_cv<_Tp>::type>::type
498 template<
typename _Tp>
506 template<
typename _Tp>
508 :
public __or_<is_lvalue_reference<_Tp>,
509 is_rvalue_reference<_Tp>>::type
513 template<
typename _Tp>
515 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
519 template<
typename _Tp>
521 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
522 is_null_pointer<_Tp>>::type
526 template<
typename _Tp>
528 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
536 template<
typename _Tp>
538 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
539 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
543 template<
typename _Tp>
547 template<
typename _Tp>
548 struct __is_member_pointer_helper
551 template<
typename _Tp,
typename _Cp>
552 struct __is_member_pointer_helper<_Tp _Cp::*>
556 template<
typename _Tp>
557 struct is_member_pointer
558 :
public __is_member_pointer_helper<typename remove_cv<_Tp>::type>::type
563 template<
typename _Tp>
564 struct __is_referenceable
565 :
public __or_<is_object<_Tp>, is_reference<_Tp>>::type
568 template<
typename _Res,
typename... _Args>
569 struct __is_referenceable<_Res(_Args...)>
573 template<
typename _Res,
typename... _Args>
574 struct __is_referenceable<_Res(_Args......)>
585 template<
typename _Tp>
594 template<
typename _Tp>
599 template<
typename _Tp>
607 template<
typename _Tp>
614 template<
typename _Tp>
620 template<
typename _Tp>
626 template<
typename _Tp>
632 template<
typename _Tp>
638 template<
typename _Tp>
643 template<
typename _Tp,
645 struct __is_signed_helper
648 template<
typename _Tp>
649 struct __is_signed_helper<_Tp, true>
650 :
public integral_constant<bool, _Tp(-1) < _Tp(0)>
654 template<typename _Tp>
656 : public __is_signed_helper<_Tp>::type
660 template<typename _Tp>
662 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
669 struct add_rvalue_reference;
675 template<typename _Tp>
676 typename add_rvalue_reference<_Tp>::type declval() noexcept;
678 template<typename, unsigned = 0>
682 struct remove_all_extents;
684 template<typename _Tp>
685 struct __is_array_known_bounds
686 : public integral_constant<bool, (extent<_Tp>::value > 0)>
689 template<
typename _Tp>
690 struct __is_array_unknown_bounds
691 :
public __and_<is_array<_Tp>, __not_<extent<_Tp>>>::type
699 struct __do_is_destructible_impl
701 template<
typename _Tp,
typename = decltype(declval<_Tp&>().~_Tp())>
708 template<
typename _Tp>
709 struct __is_destructible_impl
710 :
public __do_is_destructible_impl
712 typedef decltype(__test<_Tp>(0)) type;
715 template<typename _Tp,
716 bool = __or_<is_void<_Tp>,
717 __is_array_unknown_bounds<_Tp>,
718 is_function<_Tp>>::value,
719 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
720 struct __is_destructible_safe;
722 template<typename _Tp>
723 struct __is_destructible_safe<_Tp, false, false>
724 : public __is_destructible_impl<typename
725 remove_all_extents<_Tp>::type>::type
728 template<
typename _Tp>
729 struct __is_destructible_safe<_Tp, true, false>
732 template<
typename _Tp>
733 struct __is_destructible_safe<_Tp, false, true>
737 template<
typename _Tp>
738 struct is_destructible
739 :
public __is_destructible_safe<_Tp>::type
746 struct __do_is_nt_destructible_impl
748 template<
typename _Tp>
749 static integral_constant<bool, noexcept(declval<_Tp&>().~_Tp())>
756 template<
typename _Tp>
757 struct __is_nt_destructible_impl
758 :
public __do_is_nt_destructible_impl
760 typedef decltype(__test<_Tp>(0)) type;
763 template<typename _Tp,
764 bool = __or_<is_void<_Tp>,
765 __is_array_unknown_bounds<_Tp>,
766 is_function<_Tp>>::value,
767 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
768 struct __is_nt_destructible_safe;
770 template<typename _Tp>
771 struct __is_nt_destructible_safe<_Tp, false, false>
772 : public __is_nt_destructible_impl<typename
773 remove_all_extents<_Tp>::type>::type
776 template<
typename _Tp>
777 struct __is_nt_destructible_safe<_Tp, true, false>
780 template<
typename _Tp>
781 struct __is_nt_destructible_safe<_Tp, false, true>
785 template<
typename _Tp>
786 struct is_nothrow_destructible
787 :
public __is_nt_destructible_safe<_Tp>::type
790 struct __do_is_default_constructible_impl
792 template<
typename _Tp,
typename = decltype(_Tp())>
799 template<
typename _Tp>
800 struct __is_default_constructible_impl
801 :
public __do_is_default_constructible_impl
803 typedef decltype(__test<_Tp>(0)) type;
806 template<typename _Tp>
807 struct __is_default_constructible_atom
808 : public __and_<__not_<is_void<_Tp>>,
809 __is_default_constructible_impl<_Tp>>::type
812 template<typename _Tp, bool = is_array<_Tp>::value>
813 struct __is_default_constructible_safe;
820 template<
typename _Tp>
821 struct __is_default_constructible_safe<_Tp, true>
822 :
public __and_<__is_array_known_bounds<_Tp>,
823 __is_default_constructible_atom<typename
824 remove_all_extents<_Tp>::type>>::type
827 template<
typename _Tp>
828 struct __is_default_constructible_safe<_Tp, false>
829 :
public __is_default_constructible_atom<_Tp>::type
833 template<
typename _Tp>
834 struct is_default_constructible
835 :
public __is_default_constructible_safe<_Tp>::type
850 struct __do_is_static_castable_impl
852 template<
typename _From,
typename _To,
typename
853 = decltype(static_cast<_To>(declval<_From>()))>
856 template<
typename,
typename>
860 template<
typename _From,
typename _To>
861 struct __is_static_castable_impl
862 :
public __do_is_static_castable_impl
864 typedef decltype(__test<_From, _To>(0)) type;
867 template<typename _From, typename _To>
868 struct __is_static_castable_safe
869 : public __is_static_castable_impl<_From, _To>::type
873 template<
typename _From,
typename _To>
874 struct __is_static_castable
875 :
public integral_constant<bool, (__is_static_castable_safe<
884 struct __do_is_direct_constructible_impl
886 template<
typename _Tp,
typename _Arg,
typename
887 = decltype(::
new _Tp(declval<_Arg>()))>
890 template<
typename,
typename>
894 template<
typename _Tp,
typename _Arg>
895 struct __is_direct_constructible_impl
896 :
public __do_is_direct_constructible_impl
898 typedef decltype(__test<_Tp, _Arg>(0)) type;
901 template<typename _Tp, typename _Arg>
902 struct __is_direct_constructible_new_safe
903 : public __and_<is_destructible<_Tp>,
904 __is_direct_constructible_impl<_Tp, _Arg>>::type
907 template<
typename,
typename>
910 template<
typename,
typename>
914 struct remove_reference;
916 template<
typename _From,
typename _To,
bool
917 = __not_<__or_<is_void<_From>,
918 is_function<_From>>>::value>
919 struct __is_base_to_derived_ref;
923 template<
typename _From,
typename _To>
924 struct __is_base_to_derived_ref<_From, _To, true>
926 typedef typename remove_cv<
typename remove_reference<_From
927 >::type>::type __src_t;
928 typedef typename remove_cv<
typename remove_reference<_To
929 >::type>::type __dst_t;
930 typedef __and_<__not_<is_same<__src_t, __dst_t>>,
931 is_base_of<__src_t, __dst_t>> type;
932 static constexpr
bool value = type::value;
935 template<
typename _From,
typename _To>
936 struct __is_base_to_derived_ref<_From, _To, false>
940 template<
typename _From,
typename _To,
bool
941 = __and_<is_lvalue_reference<_From>,
942 is_rvalue_reference<_To>>::value>
943 struct __is_lvalue_to_rvalue_ref;
947 template<
typename _From,
typename _To>
948 struct __is_lvalue_to_rvalue_ref<_From, _To, true>
950 typedef typename remove_cv<
typename remove_reference<
951 _From>::type>::type __src_t;
952 typedef typename remove_cv<
typename remove_reference<
953 _To>::type>::type __dst_t;
954 typedef __and_<__not_<is_function<__src_t>>,
955 __or_<is_same<__src_t, __dst_t>,
956 is_base_of<__dst_t, __src_t>>> type;
957 static constexpr
bool value = type::value;
960 template<
typename _From,
typename _To>
961 struct __is_lvalue_to_rvalue_ref<_From, _To, false>
971 template<
typename _Tp,
typename _Arg>
972 struct __is_direct_constructible_ref_cast
973 :
public __and_<__is_static_castable<_Arg, _Tp>,
974 __not_<__or_<__is_base_to_derived_ref<_Arg, _Tp>,
975 __is_lvalue_to_rvalue_ref<_Arg, _Tp>
979 template<
typename _Tp,
typename _Arg>
980 struct __is_direct_constructible_new
981 :
public conditional<is_reference<_Tp>::value,
982 __is_direct_constructible_ref_cast<_Tp, _Arg>,
983 __is_direct_constructible_new_safe<_Tp, _Arg>
987 template<
typename _Tp,
typename _Arg>
988 struct __is_direct_constructible
989 :
public __is_direct_constructible_new<_Tp, _Arg>::type
997 struct __do_is_nary_constructible_impl
999 template<
typename _Tp,
typename... _Args,
typename
1000 = decltype(_Tp(declval<_Args>()...))>
1003 template<
typename,
typename...>
1007 template<
typename _Tp,
typename... _Args>
1008 struct __is_nary_constructible_impl
1009 :
public __do_is_nary_constructible_impl
1011 typedef decltype(__test<_Tp, _Args...>(0)) type;
1014 template<typename _Tp, typename... _Args>
1015 struct __is_nary_constructible
1016 : public __is_nary_constructible_impl<_Tp, _Args...>::type
1018 static_assert(
sizeof...(_Args) > 1,
1019 "Only useful for > 1 arguments");
1022 template<
typename _Tp,
typename... _Args>
1023 struct __is_constructible_impl
1024 :
public __is_nary_constructible<_Tp, _Args...>
1027 template<
typename _Tp,
typename _Arg>
1028 struct __is_constructible_impl<_Tp, _Arg>
1029 :
public __is_direct_constructible<_Tp, _Arg>
1032 template<
typename _Tp>
1033 struct __is_constructible_impl<_Tp>
1034 :
public is_default_constructible<_Tp>
1038 template<
typename _Tp,
typename... _Args>
1039 struct is_constructible
1040 :
public __is_constructible_impl<_Tp, _Args...>::type
1043 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1044 struct __is_copy_constructible_impl;
1046 template<
typename _Tp>
1047 struct __is_copy_constructible_impl<_Tp, false>
1050 template<
typename _Tp>
1051 struct __is_copy_constructible_impl<_Tp, true>
1052 :
public is_constructible<_Tp, const _Tp&>
1056 template<
typename _Tp>
1057 struct is_copy_constructible
1058 :
public __is_copy_constructible_impl<_Tp>
1061 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1062 struct __is_move_constructible_impl;
1064 template<
typename _Tp>
1065 struct __is_move_constructible_impl<_Tp, false>
1068 template<
typename _Tp>
1069 struct __is_move_constructible_impl<_Tp, true>
1070 :
public is_constructible<_Tp, _Tp&&>
1074 template<
typename _Tp>
1075 struct is_move_constructible
1076 :
public __is_move_constructible_impl<_Tp>
1079 template<
typename _Tp>
1080 struct __is_nt_default_constructible_atom
1081 :
public integral_constant<bool, noexcept(_Tp())>
1084 template<typename _Tp, bool = is_array<_Tp>::value>
1085 struct __is_nt_default_constructible_impl;
1087 template<
typename _Tp>
1088 struct __is_nt_default_constructible_impl<_Tp, true>
1089 :
public __and_<__is_array_known_bounds<_Tp>,
1090 __is_nt_default_constructible_atom<typename
1091 remove_all_extents<_Tp>::type>>::type
1094 template<
typename _Tp>
1095 struct __is_nt_default_constructible_impl<_Tp, false>
1096 :
public __is_nt_default_constructible_atom<_Tp>
1100 template<
typename _Tp>
1101 struct is_nothrow_default_constructible
1102 :
public __and_<is_default_constructible<_Tp>,
1103 __is_nt_default_constructible_impl<_Tp>>::type
1106 template<
typename _Tp,
typename... _Args>
1107 struct __is_nt_constructible_impl
1108 :
public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
1111 template<
typename _Tp,
typename _Arg>
1112 struct __is_nt_constructible_impl<_Tp, _Arg>
1113 :
public integral_constant<bool,
1114 noexcept(static_cast<_Tp>(declval<_Arg>()))>
1117 template<
typename _Tp>
1118 struct __is_nt_constructible_impl<_Tp>
1119 :
public is_nothrow_default_constructible<_Tp>
1123 template<
typename _Tp,
typename... _Args>
1124 struct is_nothrow_constructible
1125 :
public __and_<is_constructible<_Tp, _Args...>,
1126 __is_nt_constructible_impl<_Tp, _Args...>>::type
1129 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1130 struct __is_nothrow_copy_constructible_impl;
1132 template<
typename _Tp>
1133 struct __is_nothrow_copy_constructible_impl<_Tp, false>
1136 template<
typename _Tp>
1137 struct __is_nothrow_copy_constructible_impl<_Tp, true>
1138 :
public is_nothrow_constructible<_Tp, const _Tp&>
1142 template<
typename _Tp>
1143 struct is_nothrow_copy_constructible
1144 :
public __is_nothrow_copy_constructible_impl<_Tp>
1147 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1148 struct __is_nothrow_move_constructible_impl;
1150 template<
typename _Tp>
1151 struct __is_nothrow_move_constructible_impl<_Tp, false>
1154 template<
typename _Tp>
1155 struct __is_nothrow_move_constructible_impl<_Tp, true>
1156 :
public is_nothrow_constructible<_Tp, _Tp&&>
1160 template<
typename _Tp>
1161 struct is_nothrow_move_constructible
1162 :
public __is_nothrow_move_constructible_impl<_Tp>
1165 template<
typename _Tp,
typename _Up>
1166 class __is_assignable_helper
1168 template<
typename _Tp1,
typename _Up1,
1169 typename = decltype(declval<_Tp1>() = declval<_Up1>())>
1173 template<
typename,
typename>
1178 typedef decltype(__test<_Tp, _Up>(0)) type;
1182 template<typename _Tp, typename _Up>
1183 struct is_assignable
1184 : public __is_assignable_helper<_Tp, _Up>::type
1187 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1188 struct __is_copy_assignable_impl;
1190 template<
typename _Tp>
1191 struct __is_copy_assignable_impl<_Tp, false>
1194 template<
typename _Tp>
1195 struct __is_copy_assignable_impl<_Tp, true>
1196 :
public is_assignable<_Tp&, const _Tp&>
1200 template<
typename _Tp>
1201 struct is_copy_assignable
1202 :
public __is_copy_assignable_impl<_Tp>
1205 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1206 struct __is_move_assignable_impl;
1208 template<
typename _Tp>
1209 struct __is_move_assignable_impl<_Tp, false>
1212 template<
typename _Tp>
1213 struct __is_move_assignable_impl<_Tp, true>
1214 :
public is_assignable<_Tp&, _Tp&&>
1218 template<
typename _Tp>
1219 struct is_move_assignable
1220 :
public __is_move_assignable_impl<_Tp>
1223 template<
typename _Tp,
typename _Up>
1224 struct __is_nt_assignable_impl
1225 :
public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Up>())>
1229 template<
typename _Tp,
typename _Up>
1230 struct is_nothrow_assignable
1231 :
public __and_<is_assignable<_Tp, _Up>,
1232 __is_nt_assignable_impl<_Tp, _Up>>::type
1235 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1236 struct __is_nt_copy_assignable_impl;
1238 template<
typename _Tp>
1239 struct __is_nt_copy_assignable_impl<_Tp, false>
1242 template<
typename _Tp>
1243 struct __is_nt_copy_assignable_impl<_Tp, true>
1244 :
public is_nothrow_assignable<_Tp&, const _Tp&>
1248 template<
typename _Tp>
1249 struct is_nothrow_copy_assignable
1250 :
public __is_nt_copy_assignable_impl<_Tp>
1253 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1254 struct __is_nt_move_assignable_impl;
1256 template<
typename _Tp>
1257 struct __is_nt_move_assignable_impl<_Tp, false>
1260 template<
typename _Tp>
1261 struct __is_nt_move_assignable_impl<_Tp, true>
1262 :
public is_nothrow_assignable<_Tp&, _Tp&&>
1266 template<
typename _Tp>
1267 struct is_nothrow_move_assignable
1268 :
public __is_nt_move_assignable_impl<_Tp>
1286 template<
typename _Tp>
1287 struct is_trivially_destructible
1288 :
public __and_<is_destructible<_Tp>, integral_constant<bool,
1289 __has_trivial_destructor(_Tp)>>::type
1293 template<
typename _Tp>
1294 struct has_trivial_default_constructor
1295 :
public integral_constant<bool, __has_trivial_constructor(_Tp)>
1299 template<
typename _Tp>
1300 struct has_trivial_copy_constructor
1301 :
public integral_constant<bool, __has_trivial_copy(_Tp)>
1305 template<
typename _Tp>
1306 struct has_trivial_copy_assign
1307 :
public integral_constant<bool, __has_trivial_assign(_Tp)>
1311 template<
typename _Tp>
1312 struct has_virtual_destructor
1313 :
public integral_constant<bool, __has_virtual_destructor(_Tp)>
1320 template<
typename _Tp>
1322 :
public integral_constant<std::size_t, __alignof__(_Tp)> { };
1327 :
public integral_constant<std::size_t, 0> { };
1329 template<
typename _Tp, std::
size_t _Size>
1330 struct rank<_Tp[_Size]>
1331 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1333 template<
typename _Tp>
1335 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1338 template<
typename,
unsigned _U
int>
1340 :
public integral_constant<std::size_t, 0> { };
1342 template<
typename _Tp,
unsigned _U
int, std::
size_t _Size>
1343 struct extent<_Tp[_Size], _Uint>
1344 :
public integral_constant<std::size_t,
1345 _Uint == 0 ? _Size : extent<_Tp,
1349 template<
typename _Tp,
unsigned _U
int>
1350 struct extent<_Tp[], _Uint>
1351 :
public integral_constant<std::size_t,
1352 _Uint == 0 ? 0 : extent<_Tp,
1360 template<
typename,
typename>
1364 template<
typename _Tp>
1365 struct is_same<_Tp, _Tp>
1369 template<
typename _Base,
typename _Derived>
1371 :
public integral_constant<bool, __is_base_of(_Base, _Derived)>
1374 template<
typename _From,
typename _To,
1375 bool = __or_<is_void<_From>, is_function<_To>,
1376 is_array<_To>>::value>
1377 struct __is_convertible_helper
1378 {
typedef typename is_void<_To>::type type; };
1380 template<
typename _From,
typename _To>
1381 class __is_convertible_helper<_From, _To, false>
1383 template<
typename _To1>
1384 static void __test_aux(_To1);
1386 template<
typename _From1,
typename _To1,
1387 typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
1391 template<
typename,
typename>
1396 typedef decltype(__test<_From, _To>(0)) type;
1401 template<typename _From, typename _To>
1402 struct is_convertible
1403 : public __is_convertible_helper<_From, _To>::type
1410 template<
typename _Tp>
1412 {
typedef _Tp type; };
1414 template<
typename _Tp>
1415 struct remove_const<_Tp const>
1416 {
typedef _Tp type; };
1419 template<
typename _Tp>
1420 struct remove_volatile
1421 {
typedef _Tp type; };
1423 template<
typename _Tp>
1424 struct remove_volatile<_Tp volatile>
1425 {
typedef _Tp type; };
1428 template<
typename _Tp>
1432 remove_const<typename remove_volatile<_Tp>::type>::type type;
1436 template<
typename _Tp>
1438 {
typedef _Tp
const type; };
1441 template<
typename _Tp>
1443 {
typedef _Tp
volatile type; };
1446 template<
typename _Tp>
1450 add_const<typename add_volatile<_Tp>::type>::type type;
1453 #if __cplusplus > 201103L
1455 template<
typename _Tp>
1456 using remove_const_t =
typename remove_const<_Tp>::type;
1459 template<
typename _Tp>
1460 using remove_volatile_t =
typename remove_volatile<_Tp>::type;
1463 template<
typename _Tp>
1464 using remove_cv_t =
typename remove_cv<_Tp>::type;
1467 template<
typename _Tp>
1468 using add_const_t =
typename add_const<_Tp>::type;
1471 template<
typename _Tp>
1472 using add_volatile_t =
typename add_volatile<_Tp>::type;
1475 template<
typename _Tp>
1476 using add_cv_t =
typename add_cv<_Tp>::type;
1482 template<
typename _Tp>
1483 struct remove_reference
1484 {
typedef _Tp type; };
1486 template<
typename _Tp>
1487 struct remove_reference<_Tp&>
1488 {
typedef _Tp type; };
1490 template<
typename _Tp>
1491 struct remove_reference<_Tp&&>
1492 {
typedef _Tp type; };
1494 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1495 struct __add_lvalue_reference_helper
1496 {
typedef _Tp type; };
1498 template<
typename _Tp>
1499 struct __add_lvalue_reference_helper<_Tp, true>
1500 {
typedef _Tp& type; };
1503 template<
typename _Tp>
1504 struct add_lvalue_reference
1505 :
public __add_lvalue_reference_helper<_Tp>
1508 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1509 struct __add_rvalue_reference_helper
1510 {
typedef _Tp type; };
1512 template<
typename _Tp>
1513 struct __add_rvalue_reference_helper<_Tp, true>
1514 {
typedef _Tp&& type; };
1517 template<
typename _Tp>
1518 struct add_rvalue_reference
1519 :
public __add_rvalue_reference_helper<_Tp>
1522 #if __cplusplus > 201103L
1524 template<
typename _Tp>
1525 using remove_reference_t =
typename remove_reference<_Tp>::type;
1528 template<
typename _Tp>
1529 using add_lvalue_reference_t =
typename add_lvalue_reference<_Tp>::type;
1532 template<
typename _Tp>
1533 using add_rvalue_reference_t =
typename add_rvalue_reference<_Tp>::type;
1539 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1540 struct __cv_selector;
1542 template<
typename _Unqualified>
1543 struct __cv_selector<_Unqualified, false, false>
1544 {
typedef _Unqualified __type; };
1546 template<
typename _Unqualified>
1547 struct __cv_selector<_Unqualified, false, true>
1548 {
typedef volatile _Unqualified __type; };
1550 template<
typename _Unqualified>
1551 struct __cv_selector<_Unqualified, true, false>
1552 {
typedef const _Unqualified __type; };
1554 template<
typename _Unqualified>
1555 struct __cv_selector<_Unqualified, true, true>
1556 {
typedef const volatile _Unqualified __type; };
1558 template<
typename _Qualified,
typename _Unqualified,
1559 bool _IsConst = is_const<_Qualified>::value,
1560 bool _IsVol = is_volatile<_Qualified>::value>
1561 class __match_cv_qualifiers
1563 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1566 typedef typename __match::__type __type;
1570 template<
typename _Tp>
1571 struct __make_unsigned
1572 {
typedef _Tp __type; };
1575 struct __make_unsigned<char>
1576 {
typedef unsigned char __type; };
1579 struct __make_unsigned<signed char>
1580 {
typedef unsigned char __type; };
1583 struct __make_unsigned<short>
1584 {
typedef unsigned short __type; };
1587 struct __make_unsigned<int>
1588 {
typedef unsigned int __type; };
1591 struct __make_unsigned<long>
1592 {
typedef unsigned long __type; };
1595 struct __make_unsigned<long long>
1596 {
typedef unsigned long long __type; };
1598 #if defined(_GLIBCXX_USE_WCHAR_T) && !defined(__WCHAR_UNSIGNED__)
1600 struct __make_unsigned<wchar_t> : __make_unsigned<__WCHAR_TYPE__>
1604 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
1606 struct __make_unsigned<__int128>
1607 {
typedef unsigned __int128 __type; };
1611 template<
typename _Tp,
1612 bool _IsInt = is_integral<_Tp>::value,
1613 bool _IsEnum = is_enum<_Tp>::value>
1614 class __make_unsigned_selector;
1616 template<
typename _Tp>
1617 class __make_unsigned_selector<_Tp, true, false>
1619 typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
1620 typedef typename __unsignedt::__type __unsigned_type;
1621 typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
1624 typedef typename __cv_unsigned::__type __type;
1627 template<
typename _Tp>
1628 class __make_unsigned_selector<_Tp, false, true>
1631 typedef unsigned char __smallest;
1632 static const bool __b0 =
sizeof(_Tp) <=
sizeof(__smallest);
1633 static const bool __b1 =
sizeof(_Tp) <=
sizeof(
unsigned short);
1634 static const bool __b2 =
sizeof(_Tp) <=
sizeof(
unsigned int);
1635 typedef conditional<__b2, unsigned int, unsigned long> __cond2;
1636 typedef typename __cond2::type __cond2_type;
1637 typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
1638 typedef typename __cond1::type __cond1_type;
1641 typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
1648 template<
typename _Tp>
1649 struct make_unsigned
1650 {
typedef typename __make_unsigned_selector<_Tp>::__type type; };
1654 struct make_unsigned<bool>;
1658 template<
typename _Tp>
1659 struct __make_signed
1660 {
typedef _Tp __type; };
1663 struct __make_signed<char>
1664 {
typedef signed char __type; };
1667 struct __make_signed<unsigned char>
1668 {
typedef signed char __type; };
1671 struct __make_signed<unsigned short>
1672 {
typedef signed short __type; };
1675 struct __make_signed<unsigned int>
1676 {
typedef signed int __type; };
1679 struct __make_signed<unsigned long>
1680 {
typedef signed long __type; };
1683 struct __make_signed<unsigned long long>
1684 {
typedef signed long long __type; };
1686 #if defined(_GLIBCXX_USE_WCHAR_T) && defined(__WCHAR_UNSIGNED__)
1688 struct __make_signed<wchar_t> : __make_signed<__WCHAR_TYPE__>
1692 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
1694 struct __make_signed<char16_t> : __make_signed<uint_least16_t>
1697 struct __make_signed<char32_t> : __make_signed<uint_least32_t>
1701 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
1703 struct __make_signed<unsigned __int128>
1704 {
typedef __int128 __type; };
1708 template<
typename _Tp,
1709 bool _IsInt = is_integral<_Tp>::value,
1710 bool _IsEnum = is_enum<_Tp>::value>
1711 class __make_signed_selector;
1713 template<
typename _Tp>
1714 class __make_signed_selector<_Tp, true, false>
1716 typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
1717 typedef typename __signedt::__type __signed_type;
1718 typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
1721 typedef typename __cv_signed::__type __type;
1724 template<
typename _Tp>
1725 class __make_signed_selector<_Tp, false, true>
1728 typedef signed char __smallest;
1729 static const bool __b0 =
sizeof(_Tp) <=
sizeof(__smallest);
1730 static const bool __b1 =
sizeof(_Tp) <=
sizeof(
signed short);
1731 static const bool __b2 =
sizeof(_Tp) <=
sizeof(
signed int);
1732 typedef conditional<__b2, signed int, signed long> __cond2;
1733 typedef typename __cond2::type __cond2_type;
1734 typedef conditional<__b1, signed short, __cond2_type> __cond1;
1735 typedef typename __cond1::type __cond1_type;
1738 typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
1745 template<
typename _Tp>
1747 {
typedef typename __make_signed_selector<_Tp>::__type type; };
1751 struct make_signed<bool>;
1753 #if __cplusplus > 201103L
1755 template<
typename _Tp>
1756 using make_signed_t =
typename make_signed<_Tp>::type;
1759 template<
typename _Tp>
1760 using make_unsigned_t =
typename make_unsigned<_Tp>::type;
1766 template<
typename _Tp>
1767 struct remove_extent
1768 {
typedef _Tp type; };
1770 template<
typename _Tp, std::
size_t _Size>
1771 struct remove_extent<_Tp[_Size]>
1772 {
typedef _Tp type; };
1774 template<
typename _Tp>
1775 struct remove_extent<_Tp[]>
1776 {
typedef _Tp type; };
1779 template<
typename _Tp>
1780 struct remove_all_extents
1781 {
typedef _Tp type; };
1783 template<
typename _Tp, std::
size_t _Size>
1784 struct remove_all_extents<_Tp[_Size]>
1785 {
typedef typename remove_all_extents<_Tp>::type type; };
1787 template<
typename _Tp>
1788 struct remove_all_extents<_Tp[]>
1789 {
typedef typename remove_all_extents<_Tp>::type type; };
1791 #if __cplusplus > 201103L
1793 template<
typename _Tp>
1794 using remove_extent_t =
typename remove_extent<_Tp>::type;
1797 template<
typename _Tp>
1798 using remove_all_extents_t =
typename remove_all_extents<_Tp>::type;
1803 template<
typename _Tp,
typename>
1804 struct __remove_pointer_helper
1805 {
typedef _Tp type; };
1807 template<
typename _Tp,
typename _Up>
1808 struct __remove_pointer_helper<_Tp, _Up*>
1809 {
typedef _Up type; };
1812 template<
typename _Tp>
1813 struct remove_pointer
1814 :
public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
1818 template<
typename _Tp,
bool = __or_<__is_referenceable<_Tp>,
1819 is_
void<_Tp>>::value>
1820 struct __add_pointer_helper
1821 {
typedef _Tp type; };
1823 template<
typename _Tp>
1824 struct __add_pointer_helper<_Tp, true>
1825 {
typedef typename remove_reference<_Tp>::type* type; };
1827 template<
typename _Tp>
1829 :
public __add_pointer_helper<_Tp>
1832 #if __cplusplus > 201103L
1834 template<
typename _Tp>
1835 using remove_pointer_t =
typename remove_pointer<_Tp>::type;
1838 template<
typename _Tp>
1839 using add_pointer_t =
typename add_pointer<_Tp>::type;
1842 template<std::
size_t _Len>
1843 struct __aligned_storage_msa
1847 unsigned char __data[_Len];
1848 struct __attribute__((__aligned__)) { } __align;
1862 template<std::size_t _Len, std::size_t _Align =
1863 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
1864 struct aligned_storage
1868 unsigned char __data[_Len];
1869 struct __attribute__((__aligned__((_Align)))) { } __align;
1876 template<
typename _Up,
1877 bool _IsArray = is_array<_Up>::value,
1878 bool _IsFunction = is_function<_Up>::value>
1879 struct __decay_selector;
1882 template<
typename _Up>
1883 struct __decay_selector<_Up, false, false>
1884 {
typedef typename remove_cv<_Up>::type __type; };
1886 template<
typename _Up>
1887 struct __decay_selector<_Up, true, false>
1888 {
typedef typename remove_extent<_Up>::type* __type; };
1890 template<
typename _Up>
1891 struct __decay_selector<_Up, false, true>
1892 {
typedef typename add_pointer<_Up>::type __type; };
1895 template<
typename _Tp>
1898 typedef typename remove_reference<_Tp>::type __remove_type;
1901 typedef typename __decay_selector<__remove_type>::__type type;
1904 template<
typename _Tp>
1905 class reference_wrapper;
1908 template<
typename _Tp>
1909 struct __strip_reference_wrapper
1914 template<
typename _Tp>
1915 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
1917 typedef _Tp& __type;
1920 template<
typename _Tp>
1921 struct __decay_and_strip
1923 typedef typename __strip_reference_wrapper<
1924 typename decay<_Tp>::type>::__type __type;
1930 template<
bool,
typename _Tp =
void>
1935 template<
typename _Tp>
1936 struct enable_if<true, _Tp>
1937 {
typedef _Tp type; };
1939 template<
typename... _Cond>
1940 using _Require =
typename enable_if<__and_<_Cond...>::value>::type;
1944 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
1946 {
typedef _Iftrue type; };
1949 template<
typename _Iftrue,
typename _Iffalse>
1950 struct conditional<false, _Iftrue, _Iffalse>
1951 {
typedef _Iffalse type; };
1954 template<
typename... _Tp>
1959 struct __do_common_type_impl
1961 template<
typename _Tp,
typename _Up>
1962 static __success_type<
typename decay<decltype
1963 (
true ? std::declval<_Tp>()
1964 : std::declval<_Up>())>::type> _S_test(
int);
1966 template<
typename,
typename>
1967 static __failure_type _S_test(...);
1970 template<
typename _Tp,
typename _Up>
1971 struct __common_type_impl
1972 :
private __do_common_type_impl
1974 typedef decltype(_S_test<_Tp, _Up>(0)) type;
1977 struct __do_member_type_wrapper
1979 template<
typename _Tp>
1980 static __success_type<typename _Tp::type> _S_test(
int);
1983 static __failure_type _S_test(...);
1986 template<
typename _Tp>
1987 struct __member_type_wrapper
1988 :
private __do_member_type_wrapper
1990 typedef decltype(_S_test<_Tp>(0)) type;
1993 template<typename _CTp, typename... _Args>
1994 struct __expanded_common_type_wrapper
1996 typedef common_type<
typename _CTp::type, _Args...> type;
1999 template<
typename... _Args>
2000 struct __expanded_common_type_wrapper<__failure_type, _Args...>
2001 {
typedef __failure_type type; };
2003 template<
typename _Tp>
2004 struct common_type<_Tp>
2005 {
typedef typename decay<_Tp>::type type; };
2007 template<
typename _Tp,
typename _Up>
2008 struct common_type<_Tp, _Up>
2009 :
public __common_type_impl<_Tp, _Up>::type
2012 template<
typename _Tp,
typename _Up,
typename... _Vp>
2013 struct common_type<_Tp, _Up, _Vp...>
2014 :
public __expanded_common_type_wrapper<typename __member_type_wrapper<
2015 common_type<_Tp, _Up>>::type, _Vp...>::type
2019 template<
typename _Tp>
2020 struct underlying_type
2022 typedef __underlying_type(_Tp) type;
2025 template<typename _Tp>
2026 struct __declval_protector
2028 static const bool __stop =
false;
2029 static typename add_rvalue_reference<_Tp>::type __delegate();
2032 template<
typename _Tp>
2033 inline typename add_rvalue_reference<_Tp>::type
2036 static_assert(__declval_protector<_Tp>::__stop,
2037 "declval() must not be used!");
2038 return __declval_protector<_Tp>::__delegate();
2042 template<
typename _Signature>
2048 struct __result_of_memfun_ref_impl
2050 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2051 static __success_type<decltype(
2052 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2055 template<
typename...>
2056 static __failure_type _S_test(...);
2059 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2060 struct __result_of_memfun_ref
2061 :
private __result_of_memfun_ref_impl
2063 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2067 struct __result_of_memfun_deref_impl
2069 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2070 static __success_type<decltype(
2071 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2074 template<
typename...>
2075 static __failure_type _S_test(...);
2078 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2079 struct __result_of_memfun_deref
2080 :
private __result_of_memfun_deref_impl
2082 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2086 struct __result_of_memobj_ref_impl
2088 template<
typename _Fp,
typename _Tp1>
2089 static __success_type<decltype(
2090 std::declval<_Tp1>().*std::declval<_Fp>()
2093 template<
typename,
typename>
2094 static __failure_type _S_test(...);
2097 template<
typename _MemPtr,
typename _Arg>
2098 struct __result_of_memobj_ref
2099 :
private __result_of_memobj_ref_impl
2101 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2105 struct __result_of_memobj_deref_impl
2107 template<
typename _Fp,
typename _Tp1>
2108 static __success_type<decltype(
2109 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2112 template<
typename,
typename>
2113 static __failure_type _S_test(...);
2116 template<
typename _MemPtr,
typename _Arg>
2117 struct __result_of_memobj_deref
2118 :
private __result_of_memobj_deref_impl
2120 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2123 template<typename _MemPtr, typename _Arg>
2124 struct __result_of_memobj;
2126 template<typename _Res, typename _Class, typename _Arg>
2127 struct __result_of_memobj<_Res _Class::*, _Arg>
2129 typedef typename remove_cv<
typename remove_reference<
2130 _Arg>::type>::type _Argval;
2131 typedef _Res _Class::* _MemPtr;
2132 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2133 is_base_of<_Class, _Argval>>::value,
2134 __result_of_memobj_ref<_MemPtr, _Arg>,
2135 __result_of_memobj_deref<_MemPtr, _Arg>
2139 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2140 struct __result_of_memfun;
2142 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2143 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2145 typedef typename remove_cv<
typename remove_reference<
2146 _Arg>::type>::type _Argval;
2147 typedef _Res _Class::* _MemPtr;
2148 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2149 is_base_of<_Class, _Argval>>::value,
2150 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2151 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2155 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2156 struct __result_of_impl
2158 typedef __failure_type type;
2161 template<
typename _MemPtr,
typename _Arg>
2162 struct __result_of_impl<true, false, _MemPtr, _Arg>
2163 :
public __result_of_memobj<typename decay<_MemPtr>::type, _Arg>
2166 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2167 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2168 :
public __result_of_memfun<typename decay<_MemPtr>::type, _Arg, _Args...>
2172 struct __result_of_other_impl
2174 template<
typename _Fn,
typename... _Args>
2175 static __success_type<decltype(
2176 std::declval<_Fn>()(std::declval<_Args>()...)
2179 template<
typename...>
2180 static __failure_type _S_test(...);
2183 template<
typename _Functor,
typename... _ArgTypes>
2184 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2185 :
private __result_of_other_impl
2187 typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2190 template<typename _Functor, typename... _ArgTypes>
2191 struct result_of<_Functor(_ArgTypes...)>
2192 : public __result_of_impl<
2193 is_member_object_pointer<
2194 typename remove_reference<_Functor>::type
2196 is_member_function_pointer<
2197 typename remove_reference<_Functor>::type
2199 _Functor, _ArgTypes...
2203 #if __cplusplus > 201103L
2205 template<
size_t _Len,
size_t _Align =
2206 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2207 using aligned_storage_t =
typename aligned_storage<_Len, _Align>::type;
2210 template<
typename _Tp>
2211 using decay_t =
typename decay<_Tp>::type;
2214 template<
bool _Cond,
typename _Tp =
void>
2215 using enable_if_t =
typename enable_if<_Cond, _Tp>::type;
2218 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2219 using conditional_t =
typename conditional<_Cond, _Iftrue, _Iffalse>::type;
2222 template<
typename... _Tp>
2223 using common_type_t =
typename common_type<_Tp...>::type;
2226 template<
typename _Tp>
2227 using underlying_type_t =
typename underlying_type<_Tp>::type;
2230 template<
typename _Tp>
2231 using result_of_t =
typename result_of<_Tp>::type;
2240 #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2241 template<typename _Tp> \
2242 class __has_##_NTYPE##_helper \
2244 template<typename _Up> \
2248 template<typename _Up> \
2249 static true_type __test(_Wrap_type<typename _Up::_NTYPE>*); \
2251 template<typename _Up> \
2252 static false_type __test(...); \
2255 typedef decltype(__test<_Tp>(0)) type; \
2258 template<typename _Tp> \
2259 struct __has_##_NTYPE \
2260 : public __has_##_NTYPE##_helper \
2261 <typename remove_cv<_Tp>::type>::type \
2264 _GLIBCXX_END_NAMESPACE_VERSION
2269 #endif // _GLIBCXX_TYPE_TRAITS
__is_nullptr_t (extension).
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
is_member_function_pointer
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
is_null_pointer (LWG 2247).