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
77 #define __cpp_lib_integral_constant_callable 201304
79 constexpr value_type operator()()
const {
return value; }
83 template<
typename _Tp, _Tp __v>
94 template<
bool,
typename,
typename>
105 template<
typename _B1>
110 template<
typename _B1,
typename _B2>
111 struct __or_<_B1, _B2>
112 :
public conditional<_B1::value, _B1, _B2>::type
115 template<
typename _B1,
typename _B2,
typename _B3,
typename... _Bn>
116 struct __or_<_B1, _B2, _B3, _Bn...>
117 :
public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
120 template<
typename...>
128 template<
typename _B1>
133 template<
typename _B1,
typename _B2>
134 struct __and_<_B1, _B2>
135 :
public conditional<_B1::value, _B2, _B1>::type
138 template<
typename _B1,
typename _B2,
typename _B3,
typename... _Bn>
139 struct __and_<_B1, _B2, _B3, _Bn...>
140 :
public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
143 template<
typename _Pp>
145 :
public integral_constant<bool, !_Pp::value>
153 template<
typename _Tp>
154 struct __success_type
155 {
typedef _Tp type; };
157 struct __failure_type
166 struct __is_void_helper
170 struct __is_void_helper<void>
174 template<
typename _Tp>
176 :
public __is_void_helper<typename remove_cv<_Tp>::type>
::type
180 struct __is_integral_helper
184 struct __is_integral_helper<bool>
188 struct __is_integral_helper<char>
192 struct __is_integral_helper<signed char>
196 struct __is_integral_helper<unsigned char>
199 #ifdef _GLIBCXX_USE_WCHAR_T
201 struct __is_integral_helper<wchar_t>
206 struct __is_integral_helper<char16_t>
210 struct __is_integral_helper<char32_t>
214 struct __is_integral_helper<short>
218 struct __is_integral_helper<unsigned short>
222 struct __is_integral_helper<int>
226 struct __is_integral_helper<unsigned int>
230 struct __is_integral_helper<long>
234 struct __is_integral_helper<unsigned long>
238 struct __is_integral_helper<long long>
242 struct __is_integral_helper<unsigned long long>
245 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
247 struct __is_integral_helper<__int128>
251 struct __is_integral_helper<unsigned __int128>
256 template<
typename _Tp>
258 :
public __is_integral_helper<typename remove_cv<_Tp>::type>
::type
262 struct __is_floating_point_helper
266 struct __is_floating_point_helper<float>
270 struct __is_floating_point_helper<double>
274 struct __is_floating_point_helper<long double>
277 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
279 struct __is_floating_point_helper<__float128>
284 template<
typename _Tp>
286 :
public __is_floating_point_helper<typename remove_cv<_Tp>::type>::type
294 template<
typename _Tp, std::
size_t _Size>
298 template<
typename _Tp>
299 struct is_array<_Tp[]>
303 struct __is_pointer_helper
306 template<
typename _Tp>
307 struct __is_pointer_helper<_Tp*>
311 template<
typename _Tp>
313 :
public __is_pointer_helper<typename remove_cv<_Tp>::type>::type
321 template<
typename _Tp>
330 template<
typename _Tp>
338 struct __is_member_object_pointer_helper
341 template<
typename _Tp,
typename _Cp>
342 struct __is_member_object_pointer_helper<_Tp _Cp::*>
346 template<
typename _Tp>
348 :
public __is_member_object_pointer_helper<
349 typename remove_cv<_Tp>::type>::type
353 struct __is_member_function_pointer_helper
356 template<
typename _Tp,
typename _Cp>
357 struct __is_member_function_pointer_helper<_Tp _Cp::*>
358 :
public integral_constant<bool, is_function<_Tp>::value> { };
361 template<
typename _Tp>
363 :
public __is_member_function_pointer_helper<
364 typename remove_cv<_Tp>::type>
::type
368 template<
typename _Tp>
374 template<
typename _Tp>
380 template<
typename _Tp>
390 template<
typename _Res,
typename... _ArgTypes>
391 struct is_function<_Res(_ArgTypes...)>
394 template<
typename _Res,
typename... _ArgTypes>
395 struct is_function<_Res(_ArgTypes...) &>
398 template<
typename _Res,
typename... _ArgTypes>
399 struct is_function<_Res(_ArgTypes...) &&>
402 template<
typename _Res,
typename... _ArgTypes>
403 struct is_function<_Res(_ArgTypes......)>
406 template<
typename _Res,
typename... _ArgTypes>
407 struct is_function<_Res(_ArgTypes......) &>
410 template<
typename _Res,
typename... _ArgTypes>
411 struct is_function<_Res(_ArgTypes......) &&>
414 template<
typename _Res,
typename... _ArgTypes>
415 struct is_function<_Res(_ArgTypes...) const>
418 template<
typename _Res,
typename... _ArgTypes>
419 struct is_function<_Res(_ArgTypes...) const &>
422 template<
typename _Res,
typename... _ArgTypes>
423 struct is_function<_Res(_ArgTypes...) const &&>
426 template<
typename _Res,
typename... _ArgTypes>
427 struct is_function<_Res(_ArgTypes......) const>
430 template<
typename _Res,
typename... _ArgTypes>
431 struct is_function<_Res(_ArgTypes......) const &>
434 template<
typename _Res,
typename... _ArgTypes>
435 struct is_function<_Res(_ArgTypes......) const &&>
438 template<
typename _Res,
typename... _ArgTypes>
439 struct is_function<_Res(_ArgTypes...) volatile>
442 template<
typename _Res,
typename... _ArgTypes>
443 struct is_function<_Res(_ArgTypes...) volatile &>
446 template<
typename _Res,
typename... _ArgTypes>
447 struct is_function<_Res(_ArgTypes...) volatile &&>
450 template<
typename _Res,
typename... _ArgTypes>
451 struct is_function<_Res(_ArgTypes......) volatile>
454 template<
typename _Res,
typename... _ArgTypes>
455 struct is_function<_Res(_ArgTypes......) volatile &>
458 template<
typename _Res,
typename... _ArgTypes>
459 struct is_function<_Res(_ArgTypes......) volatile &&>
462 template<
typename _Res,
typename... _ArgTypes>
463 struct is_function<_Res(_ArgTypes...) const volatile>
466 template<
typename _Res,
typename... _ArgTypes>
467 struct is_function<_Res(_ArgTypes...) const volatile &>
470 template<
typename _Res,
typename... _ArgTypes>
471 struct is_function<_Res(_ArgTypes...) const volatile &&>
474 template<
typename _Res,
typename... _ArgTypes>
475 struct is_function<_Res(_ArgTypes......) const volatile>
478 template<
typename _Res,
typename... _ArgTypes>
479 struct is_function<_Res(_ArgTypes......) const volatile &>
482 template<
typename _Res,
typename... _ArgTypes>
483 struct is_function<_Res(_ArgTypes......) const volatile &&>
486 #define __cpp_lib_is_null_pointer 201309
489 struct __is_null_pointer_helper
493 struct __is_null_pointer_helper<std::nullptr_t>
497 template<
typename _Tp>
499 :
public __is_null_pointer_helper<typename remove_cv<_Tp>::type>::type
503 template<
typename _Tp>
511 template<
typename _Tp>
513 :
public __or_<is_lvalue_reference<_Tp>,
514 is_rvalue_reference<_Tp>>::type
518 template<
typename _Tp>
520 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
524 template<
typename _Tp>
526 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
527 is_null_pointer<_Tp>>::type
531 template<
typename _Tp>
533 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
541 template<
typename _Tp>
543 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
544 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
548 template<
typename _Tp>
552 template<
typename _Tp>
553 struct __is_member_pointer_helper
556 template<
typename _Tp,
typename _Cp>
557 struct __is_member_pointer_helper<_Tp _Cp::*>
561 template<
typename _Tp>
562 struct is_member_pointer
563 :
public __is_member_pointer_helper<typename remove_cv<_Tp>::type>::type
568 template<
typename _Tp>
569 struct __is_referenceable
570 :
public __or_<is_object<_Tp>, is_reference<_Tp>>::type
573 template<
typename _Res,
typename... _Args>
574 struct __is_referenceable<_Res(_Args...)>
578 template<
typename _Res,
typename... _Args>
579 struct __is_referenceable<_Res(_Args......)>
590 template<
typename _Tp>
599 template<
typename _Tp>
604 template<
typename _Tp>
612 template<
typename _Tp>
619 template<
typename _Tp>
625 template<
typename _Tp>
631 template<
typename _Tp>
637 template<
typename _Tp>
642 #if __cplusplus > 201103L
644 #define __cpp_lib_is_final 201402L
645 template<
typename _Tp>
652 template<
typename _Tp>
657 template<
typename _Tp,
659 struct __is_signed_helper
662 template<
typename _Tp>
663 struct __is_signed_helper<_Tp, true>
664 :
public integral_constant<bool, _Tp(-1) < _Tp(0)>
668 template<typename _Tp>
670 : public __is_signed_helper<_Tp>::type
674 template<typename _Tp>
676 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
683 struct add_rvalue_reference;
689 template<typename _Tp>
690 typename add_rvalue_reference<_Tp>::type declval() noexcept;
692 template<typename, unsigned = 0>
696 struct remove_all_extents;
698 template<typename _Tp>
699 struct __is_array_known_bounds
700 : public integral_constant<bool, (extent<_Tp>::value > 0)>
703 template<
typename _Tp>
704 struct __is_array_unknown_bounds
705 :
public __and_<is_array<_Tp>, __not_<extent<_Tp>>>::type
713 struct __do_is_destructible_impl
715 template<
typename _Tp,
typename = decltype(declval<_Tp&>().~_Tp())>
722 template<
typename _Tp>
723 struct __is_destructible_impl
724 :
public __do_is_destructible_impl
726 typedef decltype(__test<_Tp>(0)) type;
729 template<typename _Tp,
730 bool = __or_<is_void<_Tp>,
731 __is_array_unknown_bounds<_Tp>,
732 is_function<_Tp>>::value,
733 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
734 struct __is_destructible_safe;
736 template<typename _Tp>
737 struct __is_destructible_safe<_Tp, false, false>
738 : public __is_destructible_impl<typename
739 remove_all_extents<_Tp>::type>::type
742 template<
typename _Tp>
743 struct __is_destructible_safe<_Tp, true, false>
746 template<
typename _Tp>
747 struct __is_destructible_safe<_Tp, false, true>
751 template<
typename _Tp>
752 struct is_destructible
753 :
public __is_destructible_safe<_Tp>::type
760 struct __do_is_nt_destructible_impl
762 template<
typename _Tp>
763 static integral_constant<bool, noexcept(declval<_Tp&>().~_Tp())>
770 template<
typename _Tp>
771 struct __is_nt_destructible_impl
772 :
public __do_is_nt_destructible_impl
774 typedef decltype(__test<_Tp>(0)) type;
777 template<typename _Tp,
778 bool = __or_<is_void<_Tp>,
779 __is_array_unknown_bounds<_Tp>,
780 is_function<_Tp>>::value,
781 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
782 struct __is_nt_destructible_safe;
784 template<typename _Tp>
785 struct __is_nt_destructible_safe<_Tp, false, false>
786 : public __is_nt_destructible_impl<typename
787 remove_all_extents<_Tp>::type>::type
790 template<
typename _Tp>
791 struct __is_nt_destructible_safe<_Tp, true, false>
794 template<
typename _Tp>
795 struct __is_nt_destructible_safe<_Tp, false, true>
799 template<
typename _Tp>
800 struct is_nothrow_destructible
801 :
public __is_nt_destructible_safe<_Tp>::type
804 struct __do_is_default_constructible_impl
806 template<
typename _Tp,
typename = decltype(_Tp())>
813 template<
typename _Tp>
814 struct __is_default_constructible_impl
815 :
public __do_is_default_constructible_impl
817 typedef decltype(__test<_Tp>(0)) type;
820 template<typename _Tp>
821 struct __is_default_constructible_atom
822 : public __and_<__not_<is_void<_Tp>>,
823 __is_default_constructible_impl<_Tp>>::type
826 template<typename _Tp, bool = is_array<_Tp>::value>
827 struct __is_default_constructible_safe;
834 template<
typename _Tp>
835 struct __is_default_constructible_safe<_Tp, true>
836 :
public __and_<__is_array_known_bounds<_Tp>,
837 __is_default_constructible_atom<typename
838 remove_all_extents<_Tp>::type>>::type
841 template<
typename _Tp>
842 struct __is_default_constructible_safe<_Tp, false>
843 :
public __is_default_constructible_atom<_Tp>::type
847 template<
typename _Tp>
848 struct is_default_constructible
849 :
public __is_default_constructible_safe<_Tp>::type
864 struct __do_is_static_castable_impl
866 template<
typename _From,
typename _To,
typename
867 = decltype(static_cast<_To>(declval<_From>()))>
870 template<
typename,
typename>
874 template<
typename _From,
typename _To>
875 struct __is_static_castable_impl
876 :
public __do_is_static_castable_impl
878 typedef decltype(__test<_From, _To>(0)) type;
881 template<typename _From, typename _To>
882 struct __is_static_castable_safe
883 : public __is_static_castable_impl<_From, _To>::type
887 template<
typename _From,
typename _To>
888 struct __is_static_castable
889 :
public integral_constant<bool, (__is_static_castable_safe<
898 struct __do_is_direct_constructible_impl
900 template<
typename _Tp,
typename _Arg,
typename
901 = decltype(::
new _Tp(declval<_Arg>()))>
904 template<
typename,
typename>
908 template<
typename _Tp,
typename _Arg>
909 struct __is_direct_constructible_impl
910 :
public __do_is_direct_constructible_impl
912 typedef decltype(__test<_Tp, _Arg>(0)) type;
915 template<typename _Tp, typename _Arg>
916 struct __is_direct_constructible_new_safe
917 : public __and_<is_destructible<_Tp>,
918 __is_direct_constructible_impl<_Tp, _Arg>>::type
921 template<
typename,
typename>
924 template<
typename,
typename>
928 struct remove_reference;
930 template<
typename _From,
typename _To,
bool
931 = __not_<__or_<is_void<_From>,
932 is_function<_From>>>::value>
933 struct __is_base_to_derived_ref;
937 template<
typename _From,
typename _To>
938 struct __is_base_to_derived_ref<_From, _To, true>
940 typedef typename remove_cv<
typename remove_reference<_From
941 >::type>::type __src_t;
942 typedef typename remove_cv<
typename remove_reference<_To
943 >::type>::type __dst_t;
944 typedef __and_<__not_<is_same<__src_t, __dst_t>>,
945 is_base_of<__src_t, __dst_t>> type;
946 static constexpr
bool value = type::value;
949 template<
typename _From,
typename _To>
950 struct __is_base_to_derived_ref<_From, _To, false>
954 template<
typename _From,
typename _To,
bool
955 = __and_<is_lvalue_reference<_From>,
956 is_rvalue_reference<_To>>::value>
957 struct __is_lvalue_to_rvalue_ref;
961 template<
typename _From,
typename _To>
962 struct __is_lvalue_to_rvalue_ref<_From, _To, true>
964 typedef typename remove_cv<
typename remove_reference<
965 _From>::type>::type __src_t;
966 typedef typename remove_cv<
typename remove_reference<
967 _To>::type>::type __dst_t;
968 typedef __and_<__not_<is_function<__src_t>>,
969 __or_<is_same<__src_t, __dst_t>,
970 is_base_of<__dst_t, __src_t>>> type;
971 static constexpr
bool value = type::value;
974 template<
typename _From,
typename _To>
975 struct __is_lvalue_to_rvalue_ref<_From, _To, false>
985 template<
typename _Tp,
typename _Arg>
986 struct __is_direct_constructible_ref_cast
987 :
public __and_<__is_static_castable<_Arg, _Tp>,
988 __not_<__or_<__is_base_to_derived_ref<_Arg, _Tp>,
989 __is_lvalue_to_rvalue_ref<_Arg, _Tp>
993 template<
typename _Tp,
typename _Arg>
994 struct __is_direct_constructible_new
995 :
public conditional<is_reference<_Tp>::value,
996 __is_direct_constructible_ref_cast<_Tp, _Arg>,
997 __is_direct_constructible_new_safe<_Tp, _Arg>
1001 template<
typename _Tp,
typename _Arg>
1002 struct __is_direct_constructible
1003 :
public __is_direct_constructible_new<_Tp, _Arg>::type
1011 struct __do_is_nary_constructible_impl
1013 template<
typename _Tp,
typename... _Args,
typename
1014 = decltype(_Tp(declval<_Args>()...))>
1017 template<
typename,
typename...>
1021 template<
typename _Tp,
typename... _Args>
1022 struct __is_nary_constructible_impl
1023 :
public __do_is_nary_constructible_impl
1025 typedef decltype(__test<_Tp, _Args...>(0)) type;
1028 template<typename _Tp, typename... _Args>
1029 struct __is_nary_constructible
1030 : public __is_nary_constructible_impl<_Tp, _Args...>::type
1032 static_assert(
sizeof...(_Args) > 1,
1033 "Only useful for > 1 arguments");
1036 template<
typename _Tp,
typename... _Args>
1037 struct __is_constructible_impl
1038 :
public __is_nary_constructible<_Tp, _Args...>
1041 template<
typename _Tp,
typename _Arg>
1042 struct __is_constructible_impl<_Tp, _Arg>
1043 :
public __is_direct_constructible<_Tp, _Arg>
1046 template<
typename _Tp>
1047 struct __is_constructible_impl<_Tp>
1048 :
public is_default_constructible<_Tp>
1052 template<
typename _Tp,
typename... _Args>
1053 struct is_constructible
1054 :
public __is_constructible_impl<_Tp, _Args...>::type
1057 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1058 struct __is_copy_constructible_impl;
1060 template<
typename _Tp>
1061 struct __is_copy_constructible_impl<_Tp, false>
1064 template<
typename _Tp>
1065 struct __is_copy_constructible_impl<_Tp, true>
1066 :
public is_constructible<_Tp, const _Tp&>
1070 template<
typename _Tp>
1071 struct is_copy_constructible
1072 :
public __is_copy_constructible_impl<_Tp>
1075 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1076 struct __is_move_constructible_impl;
1078 template<
typename _Tp>
1079 struct __is_move_constructible_impl<_Tp, false>
1082 template<
typename _Tp>
1083 struct __is_move_constructible_impl<_Tp, true>
1084 :
public is_constructible<_Tp, _Tp&&>
1088 template<
typename _Tp>
1089 struct is_move_constructible
1090 :
public __is_move_constructible_impl<_Tp>
1093 template<
typename _Tp>
1094 struct __is_nt_default_constructible_atom
1095 :
public integral_constant<bool, noexcept(_Tp())>
1098 template<typename _Tp, bool = is_array<_Tp>::value>
1099 struct __is_nt_default_constructible_impl;
1101 template<
typename _Tp>
1102 struct __is_nt_default_constructible_impl<_Tp, true>
1103 :
public __and_<__is_array_known_bounds<_Tp>,
1104 __is_nt_default_constructible_atom<typename
1105 remove_all_extents<_Tp>::type>>::type
1108 template<
typename _Tp>
1109 struct __is_nt_default_constructible_impl<_Tp, false>
1110 :
public __is_nt_default_constructible_atom<_Tp>
1114 template<
typename _Tp>
1115 struct is_nothrow_default_constructible
1116 :
public __and_<is_default_constructible<_Tp>,
1117 __is_nt_default_constructible_impl<_Tp>>::type
1120 template<
typename _Tp,
typename... _Args>
1121 struct __is_nt_constructible_impl
1122 :
public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
1125 template<
typename _Tp,
typename _Arg>
1126 struct __is_nt_constructible_impl<_Tp, _Arg>
1127 :
public integral_constant<bool,
1128 noexcept(static_cast<_Tp>(declval<_Arg>()))>
1131 template<
typename _Tp>
1132 struct __is_nt_constructible_impl<_Tp>
1133 :
public is_nothrow_default_constructible<_Tp>
1137 template<
typename _Tp,
typename... _Args>
1138 struct is_nothrow_constructible
1139 :
public __and_<is_constructible<_Tp, _Args...>,
1140 __is_nt_constructible_impl<_Tp, _Args...>>::type
1143 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1144 struct __is_nothrow_copy_constructible_impl;
1146 template<
typename _Tp>
1147 struct __is_nothrow_copy_constructible_impl<_Tp, false>
1150 template<
typename _Tp>
1151 struct __is_nothrow_copy_constructible_impl<_Tp, true>
1152 :
public is_nothrow_constructible<_Tp, const _Tp&>
1156 template<
typename _Tp>
1157 struct is_nothrow_copy_constructible
1158 :
public __is_nothrow_copy_constructible_impl<_Tp>
1161 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1162 struct __is_nothrow_move_constructible_impl;
1164 template<
typename _Tp>
1165 struct __is_nothrow_move_constructible_impl<_Tp, false>
1168 template<
typename _Tp>
1169 struct __is_nothrow_move_constructible_impl<_Tp, true>
1170 :
public is_nothrow_constructible<_Tp, _Tp&&>
1174 template<
typename _Tp>
1175 struct is_nothrow_move_constructible
1176 :
public __is_nothrow_move_constructible_impl<_Tp>
1179 template<
typename _Tp,
typename _Up>
1180 class __is_assignable_helper
1182 template<
typename _Tp1,
typename _Up1,
1183 typename = decltype(declval<_Tp1>() = declval<_Up1>())>
1187 template<
typename,
typename>
1192 typedef decltype(__test<_Tp, _Up>(0)) type;
1196 template<typename _Tp, typename _Up>
1197 struct is_assignable
1198 : public __is_assignable_helper<_Tp, _Up>::type
1201 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1202 struct __is_copy_assignable_impl;
1204 template<
typename _Tp>
1205 struct __is_copy_assignable_impl<_Tp, false>
1208 template<
typename _Tp>
1209 struct __is_copy_assignable_impl<_Tp, true>
1210 :
public is_assignable<_Tp&, const _Tp&>
1214 template<
typename _Tp>
1215 struct is_copy_assignable
1216 :
public __is_copy_assignable_impl<_Tp>
1219 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1220 struct __is_move_assignable_impl;
1222 template<
typename _Tp>
1223 struct __is_move_assignable_impl<_Tp, false>
1226 template<
typename _Tp>
1227 struct __is_move_assignable_impl<_Tp, true>
1228 :
public is_assignable<_Tp&, _Tp&&>
1232 template<
typename _Tp>
1233 struct is_move_assignable
1234 :
public __is_move_assignable_impl<_Tp>
1237 template<
typename _Tp,
typename _Up>
1238 struct __is_nt_assignable_impl
1239 :
public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Up>())>
1243 template<
typename _Tp,
typename _Up>
1244 struct is_nothrow_assignable
1245 :
public __and_<is_assignable<_Tp, _Up>,
1246 __is_nt_assignable_impl<_Tp, _Up>>::type
1249 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1250 struct __is_nt_copy_assignable_impl;
1252 template<
typename _Tp>
1253 struct __is_nt_copy_assignable_impl<_Tp, false>
1256 template<
typename _Tp>
1257 struct __is_nt_copy_assignable_impl<_Tp, true>
1258 :
public is_nothrow_assignable<_Tp&, const _Tp&>
1262 template<
typename _Tp>
1263 struct is_nothrow_copy_assignable
1264 :
public __is_nt_copy_assignable_impl<_Tp>
1267 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1268 struct __is_nt_move_assignable_impl;
1270 template<
typename _Tp>
1271 struct __is_nt_move_assignable_impl<_Tp, false>
1274 template<
typename _Tp>
1275 struct __is_nt_move_assignable_impl<_Tp, true>
1276 :
public is_nothrow_assignable<_Tp&, _Tp&&>
1280 template<
typename _Tp>
1281 struct is_nothrow_move_assignable
1282 :
public __is_nt_move_assignable_impl<_Tp>
1300 template<
typename _Tp>
1301 struct is_trivially_destructible
1302 :
public __and_<is_destructible<_Tp>, integral_constant<bool,
1303 __has_trivial_destructor(_Tp)>>::type
1307 template<
typename _Tp>
1308 struct has_trivial_default_constructor
1309 :
public integral_constant<bool, __has_trivial_constructor(_Tp)>
1313 template<
typename _Tp>
1314 struct has_trivial_copy_constructor
1315 :
public integral_constant<bool, __has_trivial_copy(_Tp)>
1319 template<
typename _Tp>
1320 struct has_trivial_copy_assign
1321 :
public integral_constant<bool, __has_trivial_assign(_Tp)>
1325 template<
typename _Tp>
1326 struct has_virtual_destructor
1327 :
public integral_constant<bool, __has_virtual_destructor(_Tp)>
1334 template<
typename _Tp>
1336 :
public integral_constant<std::size_t, __alignof__(_Tp)> { };
1341 :
public integral_constant<std::size_t, 0> { };
1343 template<
typename _Tp, std::
size_t _Size>
1344 struct rank<_Tp[_Size]>
1345 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1347 template<
typename _Tp>
1349 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1352 template<
typename,
unsigned _U
int>
1354 :
public integral_constant<std::size_t, 0> { };
1356 template<
typename _Tp,
unsigned _U
int, std::
size_t _Size>
1357 struct extent<_Tp[_Size], _Uint>
1358 :
public integral_constant<std::size_t,
1359 _Uint == 0 ? _Size : extent<_Tp,
1363 template<
typename _Tp,
unsigned _U
int>
1364 struct extent<_Tp[], _Uint>
1365 :
public integral_constant<std::size_t,
1366 _Uint == 0 ? 0 : extent<_Tp,
1374 template<
typename,
typename>
1378 template<
typename _Tp>
1379 struct is_same<_Tp, _Tp>
1383 template<
typename _Base,
typename _Derived>
1385 :
public integral_constant<bool, __is_base_of(_Base, _Derived)>
1388 template<
typename _From,
typename _To,
1389 bool = __or_<is_void<_From>, is_function<_To>,
1390 is_array<_To>>::value>
1391 struct __is_convertible_helper
1392 {
typedef typename is_void<_To>::type type; };
1394 template<
typename _From,
typename _To>
1395 class __is_convertible_helper<_From, _To, false>
1397 template<
typename _To1>
1398 static void __test_aux(_To1);
1400 template<
typename _From1,
typename _To1,
1401 typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
1405 template<
typename,
typename>
1410 typedef decltype(__test<_From, _To>(0)) type;
1415 template<typename _From, typename _To>
1416 struct is_convertible
1417 : public __is_convertible_helper<_From, _To>::type
1424 template<
typename _Tp>
1426 {
typedef _Tp type; };
1428 template<
typename _Tp>
1429 struct remove_const<_Tp const>
1430 {
typedef _Tp type; };
1433 template<
typename _Tp>
1434 struct remove_volatile
1435 {
typedef _Tp type; };
1437 template<
typename _Tp>
1438 struct remove_volatile<_Tp volatile>
1439 {
typedef _Tp type; };
1442 template<
typename _Tp>
1446 remove_const<typename remove_volatile<_Tp>::type>::type type;
1450 template<
typename _Tp>
1452 {
typedef _Tp
const type; };
1455 template<
typename _Tp>
1457 {
typedef _Tp
volatile type; };
1460 template<
typename _Tp>
1464 add_const<typename add_volatile<_Tp>::type>::type type;
1467 #if __cplusplus > 201103L
1469 #define __cpp_lib_transformation_trait_aliases 201304
1472 template<
typename _Tp>
1473 using remove_const_t =
typename remove_const<_Tp>::type;
1476 template<
typename _Tp>
1477 using remove_volatile_t =
typename remove_volatile<_Tp>::type;
1480 template<
typename _Tp>
1481 using remove_cv_t =
typename remove_cv<_Tp>::type;
1484 template<
typename _Tp>
1485 using add_const_t =
typename add_const<_Tp>::type;
1488 template<
typename _Tp>
1489 using add_volatile_t =
typename add_volatile<_Tp>::type;
1492 template<
typename _Tp>
1493 using add_cv_t =
typename add_cv<_Tp>::type;
1499 template<
typename _Tp>
1500 struct remove_reference
1501 {
typedef _Tp type; };
1503 template<
typename _Tp>
1504 struct remove_reference<_Tp&>
1505 {
typedef _Tp type; };
1507 template<
typename _Tp>
1508 struct remove_reference<_Tp&&>
1509 {
typedef _Tp type; };
1511 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1512 struct __add_lvalue_reference_helper
1513 {
typedef _Tp type; };
1515 template<
typename _Tp>
1516 struct __add_lvalue_reference_helper<_Tp, true>
1517 {
typedef _Tp& type; };
1520 template<
typename _Tp>
1521 struct add_lvalue_reference
1522 :
public __add_lvalue_reference_helper<_Tp>
1525 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1526 struct __add_rvalue_reference_helper
1527 {
typedef _Tp type; };
1529 template<
typename _Tp>
1530 struct __add_rvalue_reference_helper<_Tp, true>
1531 {
typedef _Tp&& type; };
1534 template<
typename _Tp>
1535 struct add_rvalue_reference
1536 :
public __add_rvalue_reference_helper<_Tp>
1539 #if __cplusplus > 201103L
1541 template<
typename _Tp>
1542 using remove_reference_t =
typename remove_reference<_Tp>::type;
1545 template<
typename _Tp>
1546 using add_lvalue_reference_t =
typename add_lvalue_reference<_Tp>::type;
1549 template<
typename _Tp>
1550 using add_rvalue_reference_t =
typename add_rvalue_reference<_Tp>::type;
1556 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1557 struct __cv_selector;
1559 template<
typename _Unqualified>
1560 struct __cv_selector<_Unqualified, false, false>
1561 {
typedef _Unqualified __type; };
1563 template<
typename _Unqualified>
1564 struct __cv_selector<_Unqualified, false, true>
1565 {
typedef volatile _Unqualified __type; };
1567 template<
typename _Unqualified>
1568 struct __cv_selector<_Unqualified, true, false>
1569 {
typedef const _Unqualified __type; };
1571 template<
typename _Unqualified>
1572 struct __cv_selector<_Unqualified, true, true>
1573 {
typedef const volatile _Unqualified __type; };
1575 template<
typename _Qualified,
typename _Unqualified,
1576 bool _IsConst = is_const<_Qualified>::value,
1577 bool _IsVol = is_volatile<_Qualified>::value>
1578 class __match_cv_qualifiers
1580 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1583 typedef typename __match::__type __type;
1587 template<
typename _Tp>
1588 struct __make_unsigned
1589 {
typedef _Tp __type; };
1592 struct __make_unsigned<char>
1593 {
typedef unsigned char __type; };
1596 struct __make_unsigned<signed char>
1597 {
typedef unsigned char __type; };
1600 struct __make_unsigned<short>
1601 {
typedef unsigned short __type; };
1604 struct __make_unsigned<int>
1605 {
typedef unsigned int __type; };
1608 struct __make_unsigned<long>
1609 {
typedef unsigned long __type; };
1612 struct __make_unsigned<long long>
1613 {
typedef unsigned long long __type; };
1615 #if defined(_GLIBCXX_USE_WCHAR_T) && !defined(__WCHAR_UNSIGNED__)
1617 struct __make_unsigned<wchar_t> : __make_unsigned<__WCHAR_TYPE__>
1621 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
1623 struct __make_unsigned<__int128>
1624 {
typedef unsigned __int128 __type; };
1628 template<
typename _Tp,
1629 bool _IsInt = is_integral<_Tp>::value,
1630 bool _IsEnum = is_enum<_Tp>::value>
1631 class __make_unsigned_selector;
1633 template<
typename _Tp>
1634 class __make_unsigned_selector<_Tp, true, false>
1636 typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
1637 typedef typename __unsignedt::__type __unsigned_type;
1638 typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
1641 typedef typename __cv_unsigned::__type __type;
1644 template<
typename _Tp>
1645 class __make_unsigned_selector<_Tp, false, true>
1648 typedef unsigned char __smallest;
1649 static const bool __b0 =
sizeof(_Tp) <=
sizeof(__smallest);
1650 static const bool __b1 =
sizeof(_Tp) <=
sizeof(
unsigned short);
1651 static const bool __b2 =
sizeof(_Tp) <=
sizeof(
unsigned int);
1652 typedef conditional<__b2, unsigned int, unsigned long> __cond2;
1653 typedef typename __cond2::type __cond2_type;
1654 typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
1655 typedef typename __cond1::type __cond1_type;
1658 typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
1665 template<
typename _Tp>
1666 struct make_unsigned
1667 {
typedef typename __make_unsigned_selector<_Tp>::__type type; };
1671 struct make_unsigned<bool>;
1675 template<
typename _Tp>
1676 struct __make_signed
1677 {
typedef _Tp __type; };
1680 struct __make_signed<char>
1681 {
typedef signed char __type; };
1684 struct __make_signed<unsigned char>
1685 {
typedef signed char __type; };
1688 struct __make_signed<unsigned short>
1689 {
typedef signed short __type; };
1692 struct __make_signed<unsigned int>
1693 {
typedef signed int __type; };
1696 struct __make_signed<unsigned long>
1697 {
typedef signed long __type; };
1700 struct __make_signed<unsigned long long>
1701 {
typedef signed long long __type; };
1703 #if defined(_GLIBCXX_USE_WCHAR_T) && defined(__WCHAR_UNSIGNED__)
1705 struct __make_signed<wchar_t> : __make_signed<__WCHAR_TYPE__>
1709 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
1711 struct __make_signed<char16_t> : __make_signed<uint_least16_t>
1714 struct __make_signed<char32_t> : __make_signed<uint_least32_t>
1718 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
1720 struct __make_signed<unsigned __int128>
1721 {
typedef __int128 __type; };
1725 template<
typename _Tp,
1726 bool _IsInt = is_integral<_Tp>::value,
1727 bool _IsEnum = is_enum<_Tp>::value>
1728 class __make_signed_selector;
1730 template<
typename _Tp>
1731 class __make_signed_selector<_Tp, true, false>
1733 typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
1734 typedef typename __signedt::__type __signed_type;
1735 typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
1738 typedef typename __cv_signed::__type __type;
1741 template<
typename _Tp>
1742 class __make_signed_selector<_Tp, false, true>
1745 typedef signed char __smallest;
1746 static const bool __b0 =
sizeof(_Tp) <=
sizeof(__smallest);
1747 static const bool __b1 =
sizeof(_Tp) <=
sizeof(
signed short);
1748 static const bool __b2 =
sizeof(_Tp) <=
sizeof(
signed int);
1749 typedef conditional<__b2, signed int, signed long> __cond2;
1750 typedef typename __cond2::type __cond2_type;
1751 typedef conditional<__b1, signed short, __cond2_type> __cond1;
1752 typedef typename __cond1::type __cond1_type;
1755 typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
1762 template<
typename _Tp>
1764 {
typedef typename __make_signed_selector<_Tp>::__type type; };
1768 struct make_signed<bool>;
1770 #if __cplusplus > 201103L
1772 template<
typename _Tp>
1773 using make_signed_t =
typename make_signed<_Tp>::type;
1776 template<
typename _Tp>
1777 using make_unsigned_t =
typename make_unsigned<_Tp>::type;
1783 template<
typename _Tp>
1784 struct remove_extent
1785 {
typedef _Tp type; };
1787 template<
typename _Tp, std::
size_t _Size>
1788 struct remove_extent<_Tp[_Size]>
1789 {
typedef _Tp type; };
1791 template<
typename _Tp>
1792 struct remove_extent<_Tp[]>
1793 {
typedef _Tp type; };
1796 template<
typename _Tp>
1797 struct remove_all_extents
1798 {
typedef _Tp type; };
1800 template<
typename _Tp, std::
size_t _Size>
1801 struct remove_all_extents<_Tp[_Size]>
1802 {
typedef typename remove_all_extents<_Tp>::type type; };
1804 template<
typename _Tp>
1805 struct remove_all_extents<_Tp[]>
1806 {
typedef typename remove_all_extents<_Tp>::type type; };
1808 #if __cplusplus > 201103L
1810 template<
typename _Tp>
1811 using remove_extent_t =
typename remove_extent<_Tp>::type;
1814 template<
typename _Tp>
1815 using remove_all_extents_t =
typename remove_all_extents<_Tp>::type;
1820 template<
typename _Tp,
typename>
1821 struct __remove_pointer_helper
1822 {
typedef _Tp type; };
1824 template<
typename _Tp,
typename _Up>
1825 struct __remove_pointer_helper<_Tp, _Up*>
1826 {
typedef _Up type; };
1829 template<
typename _Tp>
1830 struct remove_pointer
1831 :
public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
1835 template<
typename _Tp,
bool = __or_<__is_referenceable<_Tp>,
1836 is_
void<_Tp>>::value>
1837 struct __add_pointer_helper
1838 {
typedef _Tp type; };
1840 template<
typename _Tp>
1841 struct __add_pointer_helper<_Tp, true>
1842 {
typedef typename remove_reference<_Tp>::type* type; };
1844 template<
typename _Tp>
1846 :
public __add_pointer_helper<_Tp>
1849 #if __cplusplus > 201103L
1851 template<
typename _Tp>
1852 using remove_pointer_t =
typename remove_pointer<_Tp>::type;
1855 template<
typename _Tp>
1856 using add_pointer_t =
typename add_pointer<_Tp>::type;
1859 template<std::
size_t _Len>
1860 struct __aligned_storage_msa
1864 unsigned char __data[_Len];
1865 struct __attribute__((__aligned__)) { } __align;
1879 template<std::size_t _Len, std::size_t _Align =
1880 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
1881 struct aligned_storage
1885 unsigned char __data[_Len];
1886 struct __attribute__((__aligned__((_Align)))) { } __align;
1893 template<
typename _Up,
1894 bool _IsArray = is_array<_Up>::value,
1895 bool _IsFunction = is_function<_Up>::value>
1896 struct __decay_selector;
1899 template<
typename _Up>
1900 struct __decay_selector<_Up, false, false>
1901 {
typedef typename remove_cv<_Up>::type __type; };
1903 template<
typename _Up>
1904 struct __decay_selector<_Up, true, false>
1905 {
typedef typename remove_extent<_Up>::type* __type; };
1907 template<
typename _Up>
1908 struct __decay_selector<_Up, false, true>
1909 {
typedef typename add_pointer<_Up>::type __type; };
1912 template<
typename _Tp>
1915 typedef typename remove_reference<_Tp>::type __remove_type;
1918 typedef typename __decay_selector<__remove_type>::__type type;
1921 template<
typename _Tp>
1922 class reference_wrapper;
1925 template<
typename _Tp>
1926 struct __strip_reference_wrapper
1931 template<
typename _Tp>
1932 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
1934 typedef _Tp& __type;
1937 template<
typename _Tp>
1938 struct __decay_and_strip
1940 typedef typename __strip_reference_wrapper<
1941 typename decay<_Tp>::type>::__type __type;
1947 template<
bool,
typename _Tp =
void>
1952 template<
typename _Tp>
1953 struct enable_if<true, _Tp>
1954 {
typedef _Tp type; };
1956 template<
typename... _Cond>
1957 using _Require =
typename enable_if<__and_<_Cond...>::value>::type;
1961 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
1963 {
typedef _Iftrue type; };
1966 template<
typename _Iftrue,
typename _Iffalse>
1967 struct conditional<false, _Iftrue, _Iffalse>
1968 {
typedef _Iffalse type; };
1971 template<
typename... _Tp>
1976 struct __do_common_type_impl
1978 template<
typename _Tp,
typename _Up>
1979 static __success_type<
typename decay<decltype
1980 (
true ? std::declval<_Tp>()
1981 : std::declval<_Up>())>::type> _S_test(
int);
1983 template<
typename,
typename>
1984 static __failure_type _S_test(...);
1987 template<
typename _Tp,
typename _Up>
1988 struct __common_type_impl
1989 :
private __do_common_type_impl
1991 typedef decltype(_S_test<_Tp, _Up>(0)) type;
1994 struct __do_member_type_wrapper
1996 template<
typename _Tp>
1997 static __success_type<typename _Tp::type> _S_test(
int);
2000 static __failure_type _S_test(...);
2003 template<
typename _Tp>
2004 struct __member_type_wrapper
2005 :
private __do_member_type_wrapper
2007 typedef decltype(_S_test<_Tp>(0)) type;
2010 template<typename _CTp, typename... _Args>
2011 struct __expanded_common_type_wrapper
2013 typedef common_type<
typename _CTp::type, _Args...> type;
2016 template<
typename... _Args>
2017 struct __expanded_common_type_wrapper<__failure_type, _Args...>
2018 {
typedef __failure_type type; };
2020 template<
typename _Tp>
2021 struct common_type<_Tp>
2022 {
typedef typename decay<_Tp>::type type; };
2024 template<
typename _Tp,
typename _Up>
2025 struct common_type<_Tp, _Up>
2026 :
public __common_type_impl<_Tp, _Up>::type
2029 template<
typename _Tp,
typename _Up,
typename... _Vp>
2030 struct common_type<_Tp, _Up, _Vp...>
2031 :
public __expanded_common_type_wrapper<typename __member_type_wrapper<
2032 common_type<_Tp, _Up>>::type, _Vp...>::type
2036 template<
typename _Tp>
2037 struct underlying_type
2039 typedef __underlying_type(_Tp) type;
2042 template<typename _Tp>
2043 struct __declval_protector
2045 static const bool __stop =
false;
2046 static typename add_rvalue_reference<_Tp>::type __delegate();
2049 template<
typename _Tp>
2050 inline typename add_rvalue_reference<_Tp>::type
2053 static_assert(__declval_protector<_Tp>::__stop,
2054 "declval() must not be used!");
2055 return __declval_protector<_Tp>::__delegate();
2059 template<
typename _Signature>
2064 #define __cpp_lib_result_of_sfinae 201210
2067 struct __result_of_memfun_ref_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_ref
2080 :
private __result_of_memfun_ref_impl
2082 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2086 struct __result_of_memfun_deref_impl
2088 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2089 static __success_type<decltype(
2090 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2093 template<
typename...>
2094 static __failure_type _S_test(...);
2097 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2098 struct __result_of_memfun_deref
2099 :
private __result_of_memfun_deref_impl
2101 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2105 struct __result_of_memobj_ref_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_ref
2118 :
private __result_of_memobj_ref_impl
2120 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2124 struct __result_of_memobj_deref_impl
2126 template<
typename _Fp,
typename _Tp1>
2127 static __success_type<decltype(
2128 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2131 template<
typename,
typename>
2132 static __failure_type _S_test(...);
2135 template<
typename _MemPtr,
typename _Arg>
2136 struct __result_of_memobj_deref
2137 :
private __result_of_memobj_deref_impl
2139 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2142 template<typename _MemPtr, typename _Arg>
2143 struct __result_of_memobj;
2145 template<typename _Res, typename _Class, typename _Arg>
2146 struct __result_of_memobj<_Res _Class::*, _Arg>
2148 typedef typename remove_cv<
typename remove_reference<
2149 _Arg>::type>::type _Argval;
2150 typedef _Res _Class::* _MemPtr;
2151 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2152 is_base_of<_Class, _Argval>>::value,
2153 __result_of_memobj_ref<_MemPtr, _Arg>,
2154 __result_of_memobj_deref<_MemPtr, _Arg>
2158 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2159 struct __result_of_memfun;
2161 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2162 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2164 typedef typename remove_cv<
typename remove_reference<
2165 _Arg>::type>::type _Argval;
2166 typedef _Res _Class::* _MemPtr;
2167 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2168 is_base_of<_Class, _Argval>>::value,
2169 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2170 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2174 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2175 struct __result_of_impl
2177 typedef __failure_type type;
2180 template<
typename _MemPtr,
typename _Arg>
2181 struct __result_of_impl<true, false, _MemPtr, _Arg>
2182 :
public __result_of_memobj<typename decay<_MemPtr>::type, _Arg>
2185 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2186 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2187 :
public __result_of_memfun<typename decay<_MemPtr>::type, _Arg, _Args...>
2191 struct __result_of_other_impl
2193 template<
typename _Fn,
typename... _Args>
2194 static __success_type<decltype(
2195 std::declval<_Fn>()(std::declval<_Args>()...)
2198 template<
typename...>
2199 static __failure_type _S_test(...);
2202 template<
typename _Functor,
typename... _ArgTypes>
2203 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2204 :
private __result_of_other_impl
2206 typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2209 template<typename _Functor, typename... _ArgTypes>
2210 struct result_of<_Functor(_ArgTypes...)>
2211 : public __result_of_impl<
2212 is_member_object_pointer<
2213 typename remove_reference<_Functor>::type
2215 is_member_function_pointer<
2216 typename remove_reference<_Functor>::type
2218 _Functor, _ArgTypes...
2222 #if __cplusplus > 201103L
2224 template<
size_t _Len,
size_t _Align =
2225 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2226 using aligned_storage_t =
typename aligned_storage<_Len, _Align>::type;
2229 template<
typename _Tp>
2230 using decay_t =
typename decay<_Tp>::type;
2233 template<
bool _Cond,
typename _Tp =
void>
2234 using enable_if_t =
typename enable_if<_Cond, _Tp>::type;
2237 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2238 using conditional_t =
typename conditional<_Cond, _Iftrue, _Iffalse>::type;
2241 template<
typename... _Tp>
2242 using common_type_t =
typename common_type<_Tp...>::type;
2245 template<
typename _Tp>
2246 using underlying_type_t =
typename underlying_type<_Tp>::type;
2249 template<
typename _Tp>
2250 using result_of_t =
typename result_of<_Tp>::type;
2259 #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2260 template<typename _Tp> \
2261 class __has_##_NTYPE##_helper \
2263 template<typename _Up> \
2267 template<typename _Up> \
2268 static true_type __test(_Wrap_type<typename _Up::_NTYPE>*); \
2270 template<typename _Up> \
2271 static false_type __test(...); \
2274 typedef decltype(__test<_Tp>(0)) type; \
2277 template<typename _Tp> \
2278 struct __has_##_NTYPE \
2279 : public __has_##_NTYPE##_helper \
2280 <typename remove_cv<_Tp>::type>::type \
2283 _GLIBCXX_END_NAMESPACE_VERSION
2288 #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).