29 #ifndef _GLIBCXX_TYPE_TRAITS
30 #define _GLIBCXX_TYPE_TRAITS 1
32 #pragma GCC system_header
34 #if __cplusplus < 201103L
40 namespace std _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
56 template<
typename _Tp, _Tp __v>
59 static constexpr _Tp value = __v;
60 typedef _Tp value_type;
62 constexpr
operator value_type()
const noexcept {
return value; }
63 #if __cplusplus > 201103L
65 #define __cpp_lib_integral_constant_callable 201304
67 constexpr value_type operator()()
const noexcept {
return value; }
71 template<
typename _Tp, _Tp __v>
83 #if __cplusplus > 201402L
84 # define __cpp_lib_bool_constant 201505
91 template<
bool,
typename,
typename>
94 template <
typename _Type>
95 struct __type_identity
96 {
using type = _Type; };
98 template<
typename _Tp>
99 using __type_identity_t =
typename __type_identity<_Tp>::type;
101 template<
typename...>
109 template<
typename _B1>
114 template<
typename _B1,
typename _B2>
115 struct __or_<_B1, _B2>
116 :
public conditional<_B1::value, _B1, _B2>::type
119 template<
typename _B1,
typename _B2,
typename _B3,
typename... _Bn>
120 struct __or_<_B1, _B2, _B3, _Bn...>
121 :
public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
124 template<
typename...>
132 template<
typename _B1>
137 template<
typename _B1,
typename _B2>
138 struct __and_<_B1, _B2>
139 :
public conditional<_B1::value, _B2, _B1>::type
142 template<
typename _B1,
typename _B2,
typename _B3,
typename... _Bn>
143 struct __and_<_B1, _B2, _B3, _Bn...>
144 :
public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
147 template<
typename _Pp>
149 :
public __bool_constant<!bool(_Pp::value)>
152 #if __cplusplus >= 201703L
154 template<
typename... _Bn>
155 inline constexpr
bool __or_v = __or_<_Bn...>::value;
156 template<
typename... _Bn>
157 inline constexpr
bool __and_v = __and_<_Bn...>::value;
159 #define __cpp_lib_logical_traits 201510
161 template<
typename... _Bn>
166 template<
typename... _Bn>
171 template<
typename _Pp>
176 template<
typename... _Bn>
177 inline constexpr
bool conjunction_v = conjunction<_Bn...>::value;
179 template<
typename... _Bn>
180 inline constexpr
bool disjunction_v = disjunction<_Bn...>::value;
182 template<
typename _Pp>
183 inline constexpr
bool negation_v = negation<_Pp>::value;
195 struct __is_array_unknown_bounds;
200 template <
typename _Tp,
size_t = sizeof(_Tp)>
201 constexpr
true_type __is_complete_or_unbounded(__type_identity<_Tp>)
204 template <
typename _TypeIdentity,
205 typename _NestedType =
typename _TypeIdentity::type>
206 constexpr
typename __or_<
207 is_reference<_NestedType>,
208 is_function<_NestedType>,
209 is_void<_NestedType>,
210 __is_array_unknown_bounds<_NestedType>
211 >::type __is_complete_or_unbounded(_TypeIdentity)
219 template<
typename _Tp>
220 struct __success_type
221 {
typedef _Tp type; };
223 struct __failure_type
230 template<
typename _Tp>
231 using __remove_cv_t =
typename remove_cv<_Tp>::type;
239 struct __is_void_helper
243 struct __is_void_helper<void>
247 template<
typename _Tp>
249 :
public __is_void_helper<__remove_cv_t<_Tp>>::type
253 struct __is_integral_helper
257 struct __is_integral_helper<bool>
261 struct __is_integral_helper<char>
265 struct __is_integral_helper<signed char>
269 struct __is_integral_helper<unsigned char>
275 #ifdef __WCHAR_TYPE__
277 struct __is_integral_helper<wchar_t>
281 #ifdef _GLIBCXX_USE_CHAR8_T
283 struct __is_integral_helper<char8_t>
288 struct __is_integral_helper<char16_t>
292 struct __is_integral_helper<char32_t>
296 struct __is_integral_helper<short>
300 struct __is_integral_helper<unsigned short>
304 struct __is_integral_helper<int>
308 struct __is_integral_helper<unsigned int>
312 struct __is_integral_helper<long>
316 struct __is_integral_helper<unsigned long>
320 struct __is_integral_helper<long long>
324 struct __is_integral_helper<unsigned long long>
329 #if defined(__GLIBCXX_TYPE_INT_N_0)
331 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
335 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
338 #if defined(__GLIBCXX_TYPE_INT_N_1)
340 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
344 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
347 #if defined(__GLIBCXX_TYPE_INT_N_2)
349 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
353 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
356 #if defined(__GLIBCXX_TYPE_INT_N_3)
358 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
362 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
367 template<
typename _Tp>
369 :
public __is_integral_helper<__remove_cv_t<_Tp>>
::type
373 struct __is_floating_point_helper
377 struct __is_floating_point_helper<float>
381 struct __is_floating_point_helper<double>
385 struct __is_floating_point_helper<long double>
388 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
390 struct __is_floating_point_helper<__float128>
395 template<
typename _Tp>
397 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
405 template<
typename _Tp, std::
size_t _Size>
409 template<
typename _Tp>
410 struct is_array<_Tp[]>
414 struct __is_pointer_helper
417 template<
typename _Tp>
418 struct __is_pointer_helper<_Tp*>
422 template<
typename _Tp>
424 :
public __is_pointer_helper<__remove_cv_t<_Tp>>::type
432 template<
typename _Tp>
441 template<
typename _Tp>
446 struct __is_member_object_pointer_helper
449 template<
typename _Tp,
typename _Cp>
450 struct __is_member_object_pointer_helper<_Tp _Cp::*>
451 :
public __not_<is_function<_Tp>>::type { };
454 template<
typename _Tp>
456 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
460 struct __is_member_function_pointer_helper
463 template<
typename _Tp,
typename _Cp>
464 struct __is_member_function_pointer_helper<_Tp _Cp::*>
465 :
public is_function<_Tp>::type { };
468 template<
typename _Tp>
470 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>
::type
474 template<
typename _Tp>
480 template<
typename _Tp>
486 template<
typename _Tp>
492 template<
typename _Tp>
496 template<
typename _Tp>
497 struct is_function<_Tp&>
500 template<
typename _Tp>
501 struct is_function<_Tp&&>
504 #define __cpp_lib_is_null_pointer 201309
507 struct __is_null_pointer_helper
511 struct __is_null_pointer_helper<std::nullptr_t>
515 template<
typename _Tp>
517 :
public __is_null_pointer_helper<__remove_cv_t<_Tp>>::type
521 template<
typename _Tp>
524 { } _GLIBCXX_DEPRECATED_SUGGEST(
"std::is_null_pointer");
529 template<
typename _Tp>
531 :
public __or_<is_lvalue_reference<_Tp>,
532 is_rvalue_reference<_Tp>>::type
536 template<
typename _Tp>
538 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
542 template<
typename _Tp>
544 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
545 is_null_pointer<_Tp>>::type
549 template<
typename _Tp>
551 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
559 template<
typename _Tp>
561 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
562 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
566 template<
typename _Tp>
568 :
public __not_<is_fundamental<_Tp>>
::type { };
570 template<
typename _Tp>
571 struct __is_member_pointer_helper
574 template<
typename _Tp,
typename _Cp>
575 struct __is_member_pointer_helper<_Tp _Cp::*>
579 template<
typename _Tp>
580 struct is_member_pointer
581 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
584 template<
typename,
typename>
587 template<
typename _Tp,
typename... _Types>
588 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
591 template<
typename _Tp>
592 using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>,
593 signed char,
signed short,
signed int,
signed long,
595 #if defined(__GLIBCXX_TYPE_INT_N_0)
596 ,
signed __GLIBCXX_TYPE_INT_N_0
598 #if defined(__GLIBCXX_TYPE_INT_N_1)
599 ,
signed __GLIBCXX_TYPE_INT_N_1
601 #if defined(__GLIBCXX_TYPE_INT_N_2)
602 ,
signed __GLIBCXX_TYPE_INT_N_2
604 #if defined(__GLIBCXX_TYPE_INT_N_3)
605 ,
signed __GLIBCXX_TYPE_INT_N_3
610 template<
typename _Tp>
611 using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>,
612 unsigned char,
unsigned short,
unsigned int,
unsigned long,
614 #if defined(__GLIBCXX_TYPE_INT_N_0)
615 ,
unsigned __GLIBCXX_TYPE_INT_N_0
617 #if defined(__GLIBCXX_TYPE_INT_N_1)
618 ,
unsigned __GLIBCXX_TYPE_INT_N_1
620 #if defined(__GLIBCXX_TYPE_INT_N_2)
621 ,
unsigned __GLIBCXX_TYPE_INT_N_2
623 #if defined(__GLIBCXX_TYPE_INT_N_3)
624 ,
unsigned __GLIBCXX_TYPE_INT_N_3
629 template<
typename _Tp>
630 using __is_standard_integer
631 = __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>;
634 template<
typename...>
using __void_t = void;
638 template<
typename _Tp,
typename =
void>
639 struct __is_referenceable
643 template<
typename _Tp>
644 struct __is_referenceable<_Tp, __void_t<_Tp&>>
655 template<
typename _Tp>
656 struct is_const<_Tp const>
664 template<
typename _Tp>
669 template<
typename _Tp>
673 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
674 "template argument must be a complete class or an unbounded array");
678 template<
typename _Tp>
679 struct is_trivially_copyable
682 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
683 "template argument must be a complete class or an unbounded array");
687 template<
typename _Tp>
691 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
692 "template argument must be a complete class or an unbounded array");
697 template<
typename _Tp>
699 _GLIBCXX20_DEPRECATED(
"use is_standard_layout && is_trivial instead")
703 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
704 "template argument must be a complete class or an unbounded array");
708 template<
typename _Tp>
710 _GLIBCXX17_DEPRECATED
714 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
715 "template argument must be a complete class or an unbounded array");
719 template<
typename _Tp>
725 template<
typename _Tp>
730 #if __cplusplus >= 201402L
731 #define __cpp_lib_is_final 201402L
733 template<
typename _Tp>
740 template<
typename _Tp>
745 template<
typename _Tp,
747 struct __is_signed_helper
750 template<
typename _Tp>
751 struct __is_signed_helper<_Tp, true>
752 :
public integral_constant<bool, _Tp(-1) < _Tp(0)>
756 template<typename _Tp>
758 : public __is_signed_helper<_Tp>::type
762 template<typename _Tp>
764 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>
775 template<typename _Tp, typename _Up = _Tp&&>
779 template<typename _Tp>
783 template<typename _Tp>
784 auto declval() noexcept -> decltype(__declval<_Tp>(0));
786 template<typename, unsigned = 0>
792 template<typename _Tp>
793 struct __is_array_known_bounds
797 template<
typename _Tp>
798 struct __is_array_unknown_bounds
799 :
public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
807 struct __do_is_destructible_impl
809 template<
typename _Tp,
typename = decltype(declval<_Tp&>().~_Tp())>
816 template<
typename _Tp>
817 struct __is_destructible_impl
818 :
public __do_is_destructible_impl
820 typedef decltype(__test<_Tp>(0)) type;
823 template<typename _Tp,
824 bool = __or_<is_void<_Tp>,
825 __is_array_unknown_bounds<_Tp>,
826 is_function<_Tp>>::value,
827 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
828 struct __is_destructible_safe;
830 template<typename _Tp>
831 struct __is_destructible_safe<_Tp, false, false>
832 : public __is_destructible_impl<typename
833 remove_all_extents<_Tp>::type>::type
836 template<
typename _Tp>
837 struct __is_destructible_safe<_Tp, true, false>
840 template<
typename _Tp>
841 struct __is_destructible_safe<_Tp, false, true>
845 template<
typename _Tp>
847 :
public __is_destructible_safe<_Tp>::type
849 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
850 "template argument must be a complete class or an unbounded array");
857 struct __do_is_nt_destructible_impl
859 template<
typename _Tp>
867 template<
typename _Tp>
868 struct __is_nt_destructible_impl
869 :
public __do_is_nt_destructible_impl
871 typedef decltype(__test<_Tp>(0)) type;
874 template<typename _Tp,
875 bool = __or_<is_void<_Tp>,
876 __is_array_unknown_bounds<_Tp>,
877 is_function<_Tp>>::value,
878 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
879 struct __is_nt_destructible_safe;
881 template<typename _Tp>
882 struct __is_nt_destructible_safe<_Tp, false, false>
883 : public __is_nt_destructible_impl<typename
884 remove_all_extents<_Tp>::type>::type
887 template<
typename _Tp>
888 struct __is_nt_destructible_safe<_Tp, true, false>
891 template<
typename _Tp>
892 struct __is_nt_destructible_safe<_Tp, false, true>
896 template<
typename _Tp>
898 :
public __is_nt_destructible_safe<_Tp>::type
900 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
901 "template argument must be a complete class or an unbounded array");
904 template<
typename _Tp,
typename... _Args>
905 struct __is_constructible_impl
910 template<
typename _Tp,
typename... _Args>
912 :
public __is_constructible_impl<_Tp, _Args...>
914 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
915 "template argument must be a complete class or an unbounded array");
919 template<
typename _Tp>
921 :
public __is_constructible_impl<_Tp>::type
923 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
924 "template argument must be a complete class or an unbounded array");
927 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
928 struct __is_copy_constructible_impl;
930 template<
typename _Tp>
931 struct __is_copy_constructible_impl<_Tp, false>
934 template<
typename _Tp>
935 struct __is_copy_constructible_impl<_Tp, true>
936 :
public __is_constructible_impl<_Tp, const _Tp&>
940 template<
typename _Tp>
942 :
public __is_copy_constructible_impl<_Tp>
944 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
945 "template argument must be a complete class or an unbounded array");
948 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
949 struct __is_move_constructible_impl;
951 template<
typename _Tp>
952 struct __is_move_constructible_impl<_Tp, false>
955 template<
typename _Tp>
956 struct __is_move_constructible_impl<_Tp, true>
957 :
public __is_constructible_impl<_Tp, _Tp&&>
961 template<
typename _Tp>
963 :
public __is_move_constructible_impl<_Tp>
965 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
966 "template argument must be a complete class or an unbounded array");
969 template<
typename _Tp,
typename... _Args>
974 template<
typename _Tp,
typename... _Args>
978 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
979 "template argument must be a complete class or an unbounded array");
983 template<
typename _Tp>
987 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
988 "template argument must be a complete class or an unbounded array");
992 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
993 struct __is_nothrow_copy_constructible_impl;
995 template<
typename _Tp>
996 struct __is_nothrow_copy_constructible_impl<_Tp, false>
999 template<
typename _Tp>
1000 struct __is_nothrow_copy_constructible_impl<_Tp, true>
1001 :
public __is_nothrow_constructible_impl<_Tp, const _Tp&>
1005 template<
typename _Tp>
1007 :
public __is_nothrow_copy_constructible_impl<_Tp>::type
1009 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1010 "template argument must be a complete class or an unbounded array");
1013 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1014 struct __is_nothrow_move_constructible_impl;
1016 template<
typename _Tp>
1017 struct __is_nothrow_move_constructible_impl<_Tp, false>
1020 template<
typename _Tp>
1021 struct __is_nothrow_move_constructible_impl<_Tp, true>
1022 :
public __is_nothrow_constructible_impl<_Tp, _Tp&&>
1026 template<
typename _Tp>
1028 :
public __is_nothrow_move_constructible_impl<_Tp>::type
1030 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1031 "template argument must be a complete class or an unbounded array");
1035 template<
typename _Tp,
typename _Up>
1039 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1040 "template argument must be a complete class or an unbounded array");
1043 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1044 struct __is_copy_assignable_impl;
1046 template<
typename _Tp>
1047 struct __is_copy_assignable_impl<_Tp, false>
1050 template<
typename _Tp>
1051 struct __is_copy_assignable_impl<_Tp, true>
1052 :
public __bool_constant<__is_assignable(_Tp&, const _Tp&)>
1056 template<
typename _Tp>
1058 :
public __is_copy_assignable_impl<_Tp>::type
1060 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1061 "template argument must be a complete class or an unbounded array");
1064 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1065 struct __is_move_assignable_impl;
1067 template<
typename _Tp>
1068 struct __is_move_assignable_impl<_Tp, false>
1071 template<
typename _Tp>
1072 struct __is_move_assignable_impl<_Tp, true>
1073 :
public __bool_constant<__is_assignable(_Tp&, _Tp&&)>
1077 template<
typename _Tp>
1079 :
public __is_move_assignable_impl<_Tp>::type
1081 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1082 "template argument must be a complete class or an unbounded array");
1085 template<
typename _Tp,
typename _Up>
1090 template<
typename _Tp,
typename _Up>
1094 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1095 "template argument must be a complete class or an unbounded array");
1098 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1099 struct __is_nt_copy_assignable_impl;
1101 template<
typename _Tp>
1102 struct __is_nt_copy_assignable_impl<_Tp, false>
1105 template<
typename _Tp>
1106 struct __is_nt_copy_assignable_impl<_Tp, true>
1107 :
public __is_nothrow_assignable_impl<_Tp&, const _Tp&>
1111 template<
typename _Tp>
1113 :
public __is_nt_copy_assignable_impl<_Tp>
1115 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1116 "template argument must be a complete class or an unbounded array");
1119 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1120 struct __is_nt_move_assignable_impl;
1122 template<
typename _Tp>
1123 struct __is_nt_move_assignable_impl<_Tp, false>
1126 template<
typename _Tp>
1127 struct __is_nt_move_assignable_impl<_Tp, true>
1128 :
public __is_nothrow_assignable_impl<_Tp&, _Tp&&>
1132 template<
typename _Tp>
1134 :
public __is_nt_move_assignable_impl<_Tp>
1136 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1137 "template argument must be a complete class or an unbounded array");
1141 template<
typename _Tp,
typename... _Args>
1145 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1146 "template argument must be a complete class or an unbounded array");
1150 template<
typename _Tp>
1154 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1155 "template argument must be a complete class or an unbounded array");
1158 struct __do_is_implicitly_default_constructible_impl
1160 template <
typename _Tp>
1161 static void __helper(
const _Tp&);
1163 template <
typename _Tp>
1165 decltype(__helper<const _Tp&>({}))* = 0);
1170 template<
typename _Tp>
1171 struct __is_implicitly_default_constructible_impl
1172 :
public __do_is_implicitly_default_constructible_impl
1174 typedef decltype(__test(declval<_Tp>())) type;
1177 template<typename _Tp>
1178 struct __is_implicitly_default_constructible_safe
1179 : public __is_implicitly_default_constructible_impl<_Tp>::type
1182 template <
typename _Tp>
1183 struct __is_implicitly_default_constructible
1184 :
public __and_<__is_constructible_impl<_Tp>,
1185 __is_implicitly_default_constructible_safe<_Tp>>
1188 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1189 struct __is_trivially_copy_constructible_impl;
1191 template<
typename _Tp>
1192 struct __is_trivially_copy_constructible_impl<_Tp, false>
1195 template<
typename _Tp>
1196 struct __is_trivially_copy_constructible_impl<_Tp, true>
1197 :
public __and_<__is_copy_constructible_impl<_Tp>,
1198 integral_constant<bool,
1199 __is_trivially_constructible(_Tp, const _Tp&)>>
1203 template<
typename _Tp>
1205 :
public __is_trivially_copy_constructible_impl<_Tp>
1207 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1208 "template argument must be a complete class or an unbounded array");
1211 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1212 struct __is_trivially_move_constructible_impl;
1214 template<
typename _Tp>
1215 struct __is_trivially_move_constructible_impl<_Tp, false>
1218 template<
typename _Tp>
1219 struct __is_trivially_move_constructible_impl<_Tp, true>
1220 :
public __and_<__is_move_constructible_impl<_Tp>,
1221 integral_constant<bool,
1222 __is_trivially_constructible(_Tp, _Tp&&)>>
1226 template<
typename _Tp>
1228 :
public __is_trivially_move_constructible_impl<_Tp>
1230 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1231 "template argument must be a complete class or an unbounded array");
1235 template<
typename _Tp,
typename _Up>
1239 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1240 "template argument must be a complete class or an unbounded array");
1243 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1244 struct __is_trivially_copy_assignable_impl;
1246 template<
typename _Tp>
1247 struct __is_trivially_copy_assignable_impl<_Tp, false>
1250 template<
typename _Tp>
1251 struct __is_trivially_copy_assignable_impl<_Tp, true>
1252 :
public __bool_constant<__is_trivially_assignable(_Tp&, const _Tp&)>
1256 template<
typename _Tp>
1258 :
public __is_trivially_copy_assignable_impl<_Tp>
1260 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1261 "template argument must be a complete class or an unbounded array");
1264 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1265 struct __is_trivially_move_assignable_impl;
1267 template<
typename _Tp>
1268 struct __is_trivially_move_assignable_impl<_Tp, false>
1271 template<
typename _Tp>
1272 struct __is_trivially_move_assignable_impl<_Tp, true>
1273 :
public __bool_constant<__is_trivially_assignable(_Tp&, _Tp&&)>
1277 template<
typename _Tp>
1279 :
public __is_trivially_move_assignable_impl<_Tp>
1281 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1282 "template argument must be a complete class or an unbounded array");
1286 template<
typename _Tp>
1288 :
public __and_<__is_destructible_safe<_Tp>,
1289 __bool_constant<__has_trivial_destructor(_Tp)>>
1291 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1292 "template argument must be a complete class or an unbounded array");
1297 template<
typename _Tp>
1301 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1302 "template argument must be a complete class or an unbounded array");
1309 template<
typename _Tp>
1313 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1314 "template argument must be a complete class or an unbounded array");
1322 template<
typename _Tp, std::
size_t _Size>
1323 struct rank<_Tp[_Size]>
1326 template<
typename _Tp>
1328 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1331 template<
typename,
unsigned _U
int>
1333 :
public integral_constant<std::size_t, 0> { };
1335 template<
typename _Tp,
unsigned _U
int, std::
size_t _Size>
1336 struct extent<_Tp[_Size], _Uint>
1337 :
public integral_constant<std::size_t,
1338 _Uint == 0 ? _Size : extent<_Tp,
1342 template<
typename _Tp,
unsigned _U
int>
1343 struct extent<_Tp[], _Uint>
1344 :
public integral_constant<std::size_t,
1345 _Uint == 0 ? 0 : extent<_Tp,
1353 template<
typename _Tp,
typename _Up>
1355 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
1356 :
public integral_constant<bool, __is_same(_Tp, _Up)>
1362 #ifndef _GLIBCXX_HAVE_BUILTIN_IS_SAME
1363 template<
typename _Tp>
1364 struct is_same<_Tp, _Tp>
1370 template<
typename _Base,
typename _Derived>
1375 template<
typename _From,
typename _To,
1378 struct __is_convertible_helper
1383 #pragma GCC diagnostic push
1384 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1385 template<
typename _From,
typename _To>
1386 class __is_convertible_helper<_From, _To, false>
1388 template<
typename _To1>
1389 static void __test_aux(_To1) noexcept;
1391 template<typename _From1, typename _To1,
1392 typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
1396 template<typename, typename>
1401 typedef decltype(__test<_From, _To>(0)) type;
1403 #pragma GCC diagnostic pop
1406 template<
typename _From,
typename _To>
1408 :
public __is_convertible_helper<_From, _To>::type
1412 template<
typename _ToElementType,
typename _FromElementType>
1416 template<
typename _From,
typename _To,
1419 struct __is_nt_convertible_helper
1423 #pragma GCC diagnostic push
1424 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1425 template<
typename _From,
typename _To>
1426 class __is_nt_convertible_helper<_From, _To, false>
1428 template<
typename _To1>
1429 static void __test_aux(_To1) noexcept;
1431 template<typename _From1, typename _To1>
1433 __bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))>
1436 template<typename, typename>
1441 using type = decltype(__test<_From, _To>(0));
1443 #pragma GCC diagnostic pop
1446 template<
typename _From,
typename _To>
1447 struct __is_nothrow_convertible
1448 :
public __is_nt_convertible_helper<_From, _To>::type
1451 #if __cplusplus > 201703L
1452 #define __cpp_lib_is_nothrow_convertible 201806L
1454 template<
typename _From,
typename _To>
1455 struct is_nothrow_convertible
1456 :
public __is_nt_convertible_helper<_From, _To>::type
1460 template<
typename _From,
typename _To>
1461 inline constexpr
bool is_nothrow_convertible_v
1462 = is_nothrow_convertible<_From, _To>::value;
1468 template<
typename _Tp>
1470 {
typedef _Tp type; };
1472 template<
typename _Tp>
1474 {
typedef _Tp type; };
1477 template<
typename _Tp>
1479 {
typedef _Tp type; };
1481 template<
typename _Tp>
1483 {
typedef _Tp type; };
1486 template<
typename _Tp>
1488 {
using type = _Tp; };
1490 template<
typename _Tp>
1491 struct remove_cv<const _Tp>
1492 {
using type = _Tp; };
1494 template<
typename _Tp>
1495 struct remove_cv<volatile _Tp>
1496 {
using type = _Tp; };
1498 template<
typename _Tp>
1499 struct remove_cv<const volatile _Tp>
1500 {
using type = _Tp; };
1503 template<
typename _Tp>
1505 {
typedef _Tp
const type; };
1508 template<
typename _Tp>
1510 {
typedef _Tp
volatile type; };
1513 template<
typename _Tp>
1520 #if __cplusplus > 201103L
1522 #define __cpp_lib_transformation_trait_aliases 201304
1525 template<
typename _Tp>
1529 template<
typename _Tp>
1533 template<
typename _Tp>
1537 template<
typename _Tp>
1541 template<
typename _Tp>
1545 template<
typename _Tp>
1552 template<
typename _Tp>
1554 {
typedef _Tp type; };
1556 template<
typename _Tp>
1558 {
typedef _Tp type; };
1560 template<
typename _Tp>
1561 struct remove_reference<_Tp&&>
1562 {
typedef _Tp type; };
1564 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1565 struct __add_lvalue_reference_helper
1566 {
typedef _Tp type; };
1568 template<
typename _Tp>
1569 struct __add_lvalue_reference_helper<_Tp, true>
1570 {
typedef _Tp& type; };
1573 template<
typename _Tp>
1575 :
public __add_lvalue_reference_helper<_Tp>
1578 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1579 struct __add_rvalue_reference_helper
1580 {
typedef _Tp type; };
1582 template<
typename _Tp>
1583 struct __add_rvalue_reference_helper<_Tp, true>
1584 {
typedef _Tp&& type; };
1587 template<
typename _Tp>
1589 :
public __add_rvalue_reference_helper<_Tp>
1592 #if __cplusplus > 201103L
1594 template<
typename _Tp>
1598 template<
typename _Tp>
1602 template<
typename _Tp>
1609 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1610 struct __cv_selector;
1612 template<
typename _Unqualified>
1613 struct __cv_selector<_Unqualified, false, false>
1614 {
typedef _Unqualified __type; };
1616 template<
typename _Unqualified>
1617 struct __cv_selector<_Unqualified, false, true>
1618 {
typedef volatile _Unqualified __type; };
1620 template<
typename _Unqualified>
1621 struct __cv_selector<_Unqualified, true, false>
1622 {
typedef const _Unqualified __type; };
1624 template<
typename _Unqualified>
1625 struct __cv_selector<_Unqualified, true, true>
1626 {
typedef const volatile _Unqualified __type; };
1628 template<
typename _Qualified,
typename _Unqualified,
1629 bool _IsConst = is_const<_Qualified>::value,
1630 bool _IsVol = is_volatile<_Qualified>::value>
1631 class __match_cv_qualifiers
1633 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1636 typedef typename __match::__type __type;
1640 template<
typename _Tp>
1641 struct __make_unsigned
1642 {
typedef _Tp __type; };
1645 struct __make_unsigned<char>
1646 {
typedef unsigned char __type; };
1649 struct __make_unsigned<signed char>
1650 {
typedef unsigned char __type; };
1653 struct __make_unsigned<short>
1654 {
typedef unsigned short __type; };
1657 struct __make_unsigned<int>
1658 {
typedef unsigned int __type; };
1661 struct __make_unsigned<long>
1662 {
typedef unsigned long __type; };
1665 struct __make_unsigned<long long>
1666 {
typedef unsigned long long __type; };
1668 #if defined(__GLIBCXX_TYPE_INT_N_0)
1670 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1671 {
typedef unsigned __GLIBCXX_TYPE_INT_N_0 __type; };
1673 #if defined(__GLIBCXX_TYPE_INT_N_1)
1675 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1676 {
typedef unsigned __GLIBCXX_TYPE_INT_N_1 __type; };
1678 #if defined(__GLIBCXX_TYPE_INT_N_2)
1680 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1681 {
typedef unsigned __GLIBCXX_TYPE_INT_N_2 __type; };
1683 #if defined(__GLIBCXX_TYPE_INT_N_3)
1685 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1686 {
typedef unsigned __GLIBCXX_TYPE_INT_N_3 __type; };
1690 template<
typename _Tp,
1691 bool _IsInt = is_integral<_Tp>::value,
1692 bool _IsEnum = is_enum<_Tp>::value>
1693 class __make_unsigned_selector;
1695 template<
typename _Tp>
1696 class __make_unsigned_selector<_Tp, true, false>
1698 using __unsigned_type
1699 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
1703 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1706 class __make_unsigned_selector_base
1709 template<
typename...>
struct _List { };
1711 template<
typename _Tp,
typename... _Up>
1712 struct _List<_Tp, _Up...> : _List<_Up...>
1713 {
static constexpr
size_t __size =
sizeof(_Tp); };
1715 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
1718 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
1719 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
1720 {
using __type = _Uint; };
1722 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
1723 struct __select<_Sz, _List<_Uint, _UInts...>, false>
1724 : __select<_Sz, _List<_UInts...>>
1729 template<
typename _Tp>
1730 class __make_unsigned_selector<_Tp, false, true>
1731 : __make_unsigned_selector_base
1734 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
1735 unsigned long,
unsigned long long>;
1737 using __unsigned_type =
typename __select<sizeof(_Tp), _UInts>::__type;
1741 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1748 #ifdef __WCHAR_TYPE__
1750 struct __make_unsigned<wchar_t>
1753 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
1757 #ifdef _GLIBCXX_USE_CHAR8_T
1759 struct __make_unsigned<char8_t>
1762 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
1767 struct __make_unsigned<char16_t>
1770 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
1774 struct __make_unsigned<char32_t>
1777 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
1784 template<
typename _Tp>
1786 {
typedef typename __make_unsigned_selector<_Tp>::__type type; };
1794 template<
typename _Tp>
1795 struct __make_signed
1796 {
typedef _Tp __type; };
1799 struct __make_signed<char>
1800 {
typedef signed char __type; };
1803 struct __make_signed<unsigned char>
1804 {
typedef signed char __type; };
1807 struct __make_signed<unsigned short>
1808 {
typedef signed short __type; };
1811 struct __make_signed<unsigned int>
1812 {
typedef signed int __type; };
1815 struct __make_signed<unsigned long>
1816 {
typedef signed long __type; };
1819 struct __make_signed<unsigned long long>
1820 {
typedef signed long long __type; };
1822 #if defined(__GLIBCXX_TYPE_INT_N_0)
1824 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
1825 {
typedef __GLIBCXX_TYPE_INT_N_0 __type; };
1827 #if defined(__GLIBCXX_TYPE_INT_N_1)
1829 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
1830 {
typedef __GLIBCXX_TYPE_INT_N_1 __type; };
1832 #if defined(__GLIBCXX_TYPE_INT_N_2)
1834 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
1835 {
typedef __GLIBCXX_TYPE_INT_N_2 __type; };
1837 #if defined(__GLIBCXX_TYPE_INT_N_3)
1839 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
1840 {
typedef __GLIBCXX_TYPE_INT_N_3 __type; };
1844 template<
typename _Tp,
1845 bool _IsInt = is_integral<_Tp>::value,
1846 bool _IsEnum = is_enum<_Tp>::value>
1847 class __make_signed_selector;
1849 template<
typename _Tp>
1850 class __make_signed_selector<_Tp, true, false>
1853 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
1857 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
1861 template<
typename _Tp>
1862 class __make_signed_selector<_Tp, false, true>
1864 typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
1867 typedef typename __make_signed_selector<__unsigned_type>::__type __type;
1874 #if defined(__WCHAR_TYPE__)
1876 struct __make_signed<wchar_t>
1879 =
typename __make_signed_selector<wchar_t, false, true>::__type;
1883 #if defined(_GLIBCXX_USE_CHAR8_T)
1885 struct __make_signed<char8_t>
1888 =
typename __make_signed_selector<char8_t, false, true>::__type;
1893 struct __make_signed<char16_t>
1896 =
typename __make_signed_selector<char16_t, false, true>::__type;
1900 struct __make_signed<char32_t>
1903 =
typename __make_signed_selector<char32_t, false, true>::__type;
1910 template<
typename _Tp>
1912 {
typedef typename __make_signed_selector<_Tp>::__type type; };
1918 #if __cplusplus > 201103L
1920 template<
typename _Tp>
1924 template<
typename _Tp>
1931 template<
typename _Tp>
1933 {
typedef _Tp type; };
1935 template<
typename _Tp, std::
size_t _Size>
1937 {
typedef _Tp type; };
1939 template<
typename _Tp>
1940 struct remove_extent<_Tp[]>
1941 {
typedef _Tp type; };
1944 template<
typename _Tp>
1945 struct remove_all_extents
1946 {
typedef _Tp type; };
1948 template<
typename _Tp, std::
size_t _Size>
1949 struct remove_all_extents<_Tp[_Size]>
1950 {
typedef typename remove_all_extents<_Tp>::type type; };
1952 template<
typename _Tp>
1953 struct remove_all_extents<_Tp[]>
1954 {
typedef typename remove_all_extents<_Tp>::type type; };
1956 #if __cplusplus > 201103L
1958 template<
typename _Tp>
1962 template<
typename _Tp>
1968 template<
typename _Tp,
typename>
1969 struct __remove_pointer_helper
1970 {
typedef _Tp type; };
1972 template<
typename _Tp,
typename _Up>
1973 struct __remove_pointer_helper<_Tp, _Up*>
1974 {
typedef _Up type; };
1977 template<
typename _Tp>
1979 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
1983 template<
typename _Tp,
bool = __or_<__is_referenceable<_Tp>,
1984 is_
void<_Tp>>::value>
1986 {
typedef _Tp type; };
1988 template<
typename _Tp>
1990 {
typedef typename remove_reference<_Tp>::type* type; };
1992 template<
typename _Tp>
1994 :
public __add_pointer_helper<_Tp>
1997 #if __cplusplus > 201103L
1999 template<
typename _Tp>
2003 template<
typename _Tp>
2007 template<std::
size_t _Len>
2008 struct __aligned_storage_msa
2012 unsigned char __data[_Len];
2013 struct __attribute__((__aligned__)) { } __align;
2027 template<std::size_t _Len, std::size_t _Align =
2028 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2033 unsigned char __data[_Len];
2034 struct __attribute__((__aligned__((_Align)))) { } __align;
2038 template <
typename... _Types>
2039 struct __strictest_alignment
2041 static const size_t _S_alignment = 0;
2042 static const size_t _S_size = 0;
2045 template <
typename _Tp,
typename... _Types>
2046 struct __strictest_alignment<_Tp, _Types...>
2048 static const size_t _S_alignment =
2049 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2050 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2051 static const size_t _S_size =
2052 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2053 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2066 template <
size_t _Len,
typename... _Types>
2070 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2072 using __strictest = __strictest_alignment<_Types...>;
2073 static const size_t _S_len = _Len > __strictest::_S_size
2074 ? _Len : __strictest::_S_size;
2077 static const size_t alignment_value = __strictest::_S_alignment;
2082 template <
size_t _Len,
typename... _Types>
2083 const size_t aligned_union<_Len, _Types...>::alignment_value;
2087 template<
typename _Up,
2090 struct __decay_selector;
2093 template<
typename _Up>
2094 struct __decay_selector<_Up, false, false>
2095 {
typedef __remove_cv_t<_Up> __type; };
2097 template<
typename _Up>
2098 struct __decay_selector<_Up, true, false>
2099 {
typedef typename remove_extent<_Up>::type* __type; };
2101 template<
typename _Up>
2102 struct __decay_selector<_Up, false, true>
2103 {
typedef typename add_pointer<_Up>::type __type; };
2106 template<
typename _Tp>
2109 typedef typename remove_reference<_Tp>::type __remove_type;
2112 typedef typename __decay_selector<__remove_type>::__type type;
2116 template<
typename _Tp>
2117 using __decay_t =
typename decay<_Tp>::type;
2119 template<
typename _Tp>
2123 template<
typename _Tp>
2124 struct __strip_reference_wrapper
2129 template<
typename _Tp>
2132 typedef _Tp& __type;
2135 template<
typename _Tp>
2136 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2141 template<
bool,
typename _Tp =
void>
2146 template<
typename _Tp>
2148 {
typedef _Tp type; };
2151 template<
bool _Cond,
typename _Tp =
void>
2152 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
2154 template<
typename... _Cond>
2155 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2159 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2161 {
typedef _Iftrue type; };
2164 template<
typename _Iftrue,
typename _Iffalse>
2165 struct conditional<false, _Iftrue, _Iffalse>
2166 {
typedef _Iffalse type; };
2169 template<
typename _Tp>
2170 using __remove_cvref_t
2171 =
typename remove_cv<typename remove_reference<_Tp>::type>::type;
2174 template<
typename... _Tp>
2179 struct __do_common_type_impl
2181 template<
typename _Tp,
typename _Up>
2183 = decltype(
true ? std::declval<_Tp>() : std::declval<_Up>());
2187 template<
typename _Tp,
typename _Up>
2188 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2191 #if __cplusplus > 201703L
2194 template<
typename _Tp,
typename _Up>
2195 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2199 template<
typename,
typename>
2200 static __failure_type
2203 template<
typename _Tp,
typename _Up>
2204 static decltype(_S_test_2<_Tp, _Up>(0))
2214 template<
typename _Tp0>
2220 template<
typename _Tp1,
typename _Tp2,
2221 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2222 struct __common_type_impl
2226 using type = common_type<_Dp1, _Dp2>;
2229 template<
typename _Tp1,
typename _Tp2>
2230 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2231 :
private __do_common_type_impl
2235 using type = decltype(_S_test<_Tp1, _Tp2>(0));
2239 template<
typename _Tp1,
typename _Tp2>
2240 struct common_type<_Tp1, _Tp2>
2241 :
public __common_type_impl<_Tp1, _Tp2>::type
2244 template<
typename...>
2245 struct __common_type_pack
2248 template<
typename,
typename,
typename =
void>
2249 struct __common_type_fold;
2252 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2253 struct common_type<_Tp1, _Tp2, _Rp...>
2254 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2255 __common_type_pack<_Rp...>>
2261 template<
typename _CTp,
typename... _Rp>
2262 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2263 __void_t<typename _CTp::type>>
2264 :
public common_type<typename _CTp::type, _Rp...>
2268 template<
typename _CTp,
typename _Rp>
2269 struct __common_type_fold<_CTp, _Rp, void>
2272 template<typename _Tp, bool = is_enum<_Tp>::value>
2273 struct __underlying_type_impl
2275 using type = __underlying_type(_Tp);
2278 template<
typename _Tp>
2279 struct __underlying_type_impl<_Tp, false>
2283 template<
typename _Tp>
2285 :
public __underlying_type_impl<_Tp>
2288 template<
typename _Tp>
2289 struct __declval_protector
2291 static const bool __stop =
false;
2294 template<
typename _Tp>
2295 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2297 static_assert(__declval_protector<_Tp>::__stop,
2298 "declval() must not be used!");
2299 return __declval<_Tp>(0);
2303 template<
typename _Signature>
2308 #define __cpp_lib_result_of_sfinae 201210
2310 struct __invoke_memfun_ref { };
2311 struct __invoke_memfun_deref { };
2312 struct __invoke_memobj_ref { };
2313 struct __invoke_memobj_deref { };
2314 struct __invoke_other { };
2317 template<
typename _Tp,
typename _Tag>
2318 struct __result_of_success : __success_type<_Tp>
2319 {
using __invoke_type = _Tag; };
2322 struct __result_of_memfun_ref_impl
2324 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2325 static __result_of_success<decltype(
2326 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2327 ), __invoke_memfun_ref> _S_test(
int);
2329 template<
typename...>
2330 static __failure_type _S_test(...);
2333 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2334 struct __result_of_memfun_ref
2335 :
private __result_of_memfun_ref_impl
2337 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2341 struct __result_of_memfun_deref_impl
2343 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2344 static __result_of_success<decltype(
2345 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2346 ), __invoke_memfun_deref> _S_test(
int);
2348 template<
typename...>
2349 static __failure_type _S_test(...);
2352 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2353 struct __result_of_memfun_deref
2354 :
private __result_of_memfun_deref_impl
2356 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2360 struct __result_of_memobj_ref_impl
2362 template<
typename _Fp,
typename _Tp1>
2363 static __result_of_success<decltype(
2364 std::declval<_Tp1>().*std::declval<_Fp>()
2365 ), __invoke_memobj_ref> _S_test(
int);
2367 template<
typename,
typename>
2368 static __failure_type _S_test(...);
2371 template<
typename _MemPtr,
typename _Arg>
2372 struct __result_of_memobj_ref
2373 :
private __result_of_memobj_ref_impl
2375 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2379 struct __result_of_memobj_deref_impl
2381 template<
typename _Fp,
typename _Tp1>
2382 static __result_of_success<decltype(
2383 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2384 ), __invoke_memobj_deref> _S_test(
int);
2386 template<
typename,
typename>
2387 static __failure_type _S_test(...);
2390 template<
typename _MemPtr,
typename _Arg>
2391 struct __result_of_memobj_deref
2392 :
private __result_of_memobj_deref_impl
2394 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2397 template<typename _MemPtr, typename _Arg>
2398 struct __result_of_memobj;
2400 template<typename _Res, typename _Class, typename _Arg>
2401 struct __result_of_memobj<_Res _Class::*, _Arg>
2403 typedef __remove_cvref_t<_Arg> _Argval;
2404 typedef _Res _Class::* _MemPtr;
2405 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2406 is_base_of<_Class, _Argval>>::value,
2407 __result_of_memobj_ref<_MemPtr, _Arg>,
2408 __result_of_memobj_deref<_MemPtr, _Arg>
2412 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2413 struct __result_of_memfun;
2415 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2416 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2418 typedef typename remove_reference<_Arg>::type _Argval;
2419 typedef _Res _Class::* _MemPtr;
2420 typedef typename conditional<is_base_of<_Class, _Argval>::value,
2421 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2422 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2431 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2437 template<
typename _Tp,
typename _Up>
2438 struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
2443 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2444 struct __result_of_impl
2446 typedef __failure_type type;
2449 template<
typename _MemPtr,
typename _Arg>
2450 struct __result_of_impl<true, false, _MemPtr, _Arg>
2451 :
public __result_of_memobj<__decay_t<_MemPtr>,
2452 typename __inv_unwrap<_Arg>::type>
2455 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2456 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2457 :
public __result_of_memfun<__decay_t<_MemPtr>,
2458 typename __inv_unwrap<_Arg>::type, _Args...>
2462 struct __result_of_other_impl
2464 template<
typename _Fn,
typename... _Args>
2465 static __result_of_success<decltype(
2466 std::declval<_Fn>()(std::declval<_Args>()...)
2467 ), __invoke_other> _S_test(
int);
2469 template<
typename...>
2470 static __failure_type _S_test(...);
2473 template<
typename _Functor,
typename... _ArgTypes>
2474 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2475 :
private __result_of_other_impl
2477 typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2481 template<typename _Functor, typename... _ArgTypes>
2482 struct __invoke_result
2483 : public __result_of_impl<
2484 is_member_object_pointer<
2485 typename remove_reference<_Functor>::type
2487 is_member_function_pointer<
2488 typename remove_reference<_Functor>::type
2490 _Functor, _ArgTypes...
2494 template<
typename _Functor,
typename... _ArgTypes>
2495 struct result_of<_Functor(_ArgTypes...)>
2496 :
public __invoke_result<_Functor, _ArgTypes...>
2499 #if __cplusplus >= 201402L
2501 template<
size_t _Len,
size_t _Align =
2502 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2505 template <
size_t _Len,
typename... _Types>
2506 using aligned_union_t =
typename aligned_union<_Len, _Types...>::type;
2509 template<
typename _Tp>
2513 template<
bool _Cond,
typename _Tp =
void>
2517 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2521 template<
typename... _Tp>
2525 template<
typename _Tp>
2529 template<
typename _Tp>
2533 #if __cplusplus >= 201703L || !defined(__STRICT_ANSI__) // c++17 or gnu++11
2534 #define __cpp_lib_void_t 201411
2540 template<
typename _Default,
typename _AlwaysVoid,
2541 template<
typename...>
class _Op,
typename... _Args>
2545 using type = _Default;
2549 template<
typename _Default,
template<
typename...>
class _Op,
2551 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2554 using type = _Op<_Args...>;
2558 template<
typename _Default,
template<
typename...>
class _Op,
2563 template<
typename _Default,
template<
typename...>
class _Op,
2565 using __detected_or_t
2574 #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2575 template<typename _Tp, typename = __void_t<>> \
2576 struct __has_##_NTYPE \
2579 template<typename _Tp> \
2580 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
2584 template <
typename _Tp>
2585 struct __is_swappable;
2587 template <
typename _Tp>
2588 struct __is_nothrow_swappable;
2590 template<
typename... _Elements>
2597 template<
typename... _Tps>
2598 struct __is_tuple_like_impl<tuple<_Tps...>> :
true_type
2602 template<
typename _Tp>
2603 struct __is_tuple_like
2604 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
2607 template<
typename _Tp>
2608 _GLIBCXX20_CONSTEXPR
2610 _Require<__not_<__is_tuple_like<_Tp>>,
2611 is_move_constructible<_Tp>,
2612 is_move_assignable<_Tp>>
2614 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2615 is_nothrow_move_assignable<_Tp>>::value);
2617 template<typename _Tp,
size_t _Nm>
2618 _GLIBCXX20_CONSTEXPR
2620 __enable_if_t<__is_swappable<_Tp>::value>
2621 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2622 noexcept(__is_nothrow_swappable<_Tp>::value);
2624 namespace __swappable_details {
2627 struct __do_is_swappable_impl
2629 template<
typename _Tp,
typename
2630 = decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2637 struct __do_is_nothrow_swappable_impl
2639 template<
typename _Tp>
2640 static __bool_constant<
2641 noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2650 template<
typename _Tp>
2651 struct __is_swappable_impl
2652 :
public __swappable_details::__do_is_swappable_impl
2654 typedef decltype(__test<_Tp>(0)) type;
2657 template<typename _Tp>
2658 struct __is_nothrow_swappable_impl
2659 : public __swappable_details::__do_is_nothrow_swappable_impl
2661 typedef decltype(__test<_Tp>(0)) type;
2664 template<typename _Tp>
2665 struct __is_swappable
2666 : public __is_swappable_impl<_Tp>::type
2669 template<
typename _Tp>
2670 struct __is_nothrow_swappable
2671 :
public __is_nothrow_swappable_impl<_Tp>::type
2674 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
2675 #define __cpp_lib_is_swappable 201603
2679 template<
typename _Tp>
2681 :
public __is_swappable_impl<_Tp>::type
2683 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2684 "template argument must be a complete class or an unbounded array");
2688 template<
typename _Tp>
2690 :
public __is_nothrow_swappable_impl<_Tp>::type
2692 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2693 "template argument must be a complete class or an unbounded array");
2696 #if __cplusplus >= 201402L
2698 template<
typename _Tp>
2703 template<
typename _Tp>
2706 #endif // __cplusplus >= 201402L
2708 namespace __swappable_with_details {
2711 struct __do_is_swappable_with_impl
2713 template<
typename _Tp,
typename _Up,
typename
2714 = decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
2716 = decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
2719 template<
typename,
typename>
2723 struct __do_is_nothrow_swappable_with_impl
2725 template<
typename _Tp,
typename _Up>
2727 noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
2729 noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
2732 template<
typename,
typename>
2738 template<
typename _Tp,
typename _Up>
2739 struct __is_swappable_with_impl
2740 :
public __swappable_with_details::__do_is_swappable_with_impl
2742 typedef decltype(__test<_Tp, _Up>(0)) type;
2746 template<typename _Tp>
2747 struct __is_swappable_with_impl<_Tp&, _Tp&>
2748 : public __swappable_details::__do_is_swappable_impl
2750 typedef decltype(__test<_Tp&>(0)) type;
2753 template<typename _Tp, typename _Up>
2754 struct __is_nothrow_swappable_with_impl
2755 : public __swappable_with_details::__do_is_nothrow_swappable_with_impl
2757 typedef decltype(__test<_Tp, _Up>(0)) type;
2761 template<typename _Tp>
2762 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
2763 : public __swappable_details::__do_is_nothrow_swappable_impl
2765 typedef decltype(__test<_Tp&>(0)) type;
2769 template<typename _Tp, typename _Up>
2771 : public __is_swappable_with_impl<_Tp, _Up>::type
2773 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2774 "first template argument must be a complete class or an unbounded array");
2775 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
2776 "second template argument must be a complete class or an unbounded array");
2780 template<
typename _Tp,
typename _Up>
2782 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
2784 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2785 "first template argument must be a complete class or an unbounded array");
2786 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
2787 "second template argument must be a complete class or an unbounded array");
2790 #if __cplusplus >= 201402L
2792 template<
typename _Tp,
typename _Up>
2797 template<
typename _Tp,
typename _Up>
2800 #endif // __cplusplus >= 201402L
2802 #endif// c++1z or gnu++11
2807 template<
typename _Result,
typename _Ret,
2812 template<
typename _Result,
typename _Ret>
2813 struct __is_invocable_impl<_Result, _Ret,
2815 __void_t<typename _Result::type>>
2819 #pragma GCC diagnostic push
2820 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2822 template<
typename _Result,
typename _Ret>
2823 struct __is_invocable_impl<_Result, _Ret,
2825 __void_t<typename _Result::type>>
2830 static typename _Result::type _S_get();
2832 template<
typename _Tp>
2833 static void _S_conv(_Tp);
2836 template<
typename _Tp,
typename = decltype(_S_conv<_Tp>(_S_get()))>
2840 template<
typename _Tp>
2845 using type = decltype(_S_test<_Ret>(1));
2847 #pragma GCC diagnostic pop
2849 template<
typename _Fn,
typename... _ArgTypes>
2850 struct __is_invocable
2851 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2854 template<
typename _Fn,
typename _Tp,
typename... _Args>
2855 constexpr
bool __call_is_nt(__invoke_memfun_ref)
2857 using _Up =
typename __inv_unwrap<_Tp>::type;
2858 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
2859 std::declval<_Args>()...));
2862 template<
typename _Fn,
typename _Tp,
typename... _Args>
2863 constexpr
bool __call_is_nt(__invoke_memfun_deref)
2865 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
2866 std::declval<_Args>()...));
2869 template<
typename _Fn,
typename _Tp>
2870 constexpr
bool __call_is_nt(__invoke_memobj_ref)
2872 using _Up =
typename __inv_unwrap<_Tp>::type;
2873 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
2876 template<
typename _Fn,
typename _Tp>
2877 constexpr
bool __call_is_nt(__invoke_memobj_deref)
2879 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
2882 template<
typename _Fn,
typename... _Args>
2883 constexpr
bool __call_is_nt(__invoke_other)
2885 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
2888 template<
typename _Result,
typename _Fn,
typename... _Args>
2889 struct __call_is_nothrow
2891 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
2895 template<
typename _Fn,
typename... _Args>
2896 using __call_is_nothrow_
2897 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
2900 template<
typename _Fn,
typename... _Args>
2901 struct __is_nothrow_invocable
2902 : __and_<__is_invocable<_Fn, _Args...>,
2903 __call_is_nothrow_<_Fn, _Args...>>::type
2906 #pragma GCC diagnostic push
2907 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2908 struct __nonesuchbase {};
2909 struct __nonesuch :
private __nonesuchbase {
2910 ~__nonesuch() =
delete;
2911 __nonesuch(__nonesuch
const&) =
delete;
2912 void operator=(__nonesuch
const&) =
delete;
2914 #pragma GCC diagnostic pop
2916 #if __cplusplus >= 201703L
2917 # define __cpp_lib_is_invocable 201703
2920 template<
typename _Functor,
typename... _ArgTypes>
2922 :
public __invoke_result<_Functor, _ArgTypes...>
2924 static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}),
2925 "_Functor must be a complete class or an unbounded array");
2926 static_assert((std::__is_complete_or_unbounded(
2927 __type_identity<_ArgTypes>{}) && ...),
2928 "each argument type must be a complete class or an unbounded array");
2932 template<
typename _Fn,
typename... _Args>
2936 template<
typename _Fn,
typename... _ArgTypes>
2938 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2940 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2941 "_Fn must be a complete class or an unbounded array");
2942 static_assert((std::__is_complete_or_unbounded(
2943 __type_identity<_ArgTypes>{}) && ...),
2944 "each argument type must be a complete class or an unbounded array");
2948 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2950 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
2952 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2953 "_Fn must be a complete class or an unbounded array");
2954 static_assert((std::__is_complete_or_unbounded(
2955 __type_identity<_ArgTypes>{}) && ...),
2956 "each argument type must be a complete class or an unbounded array");
2957 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
2958 "_Ret must be a complete class or an unbounded array");
2962 template<
typename _Fn,
typename... _ArgTypes>
2964 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
2965 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2967 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2968 "_Fn must be a complete class or an unbounded array");
2969 static_assert((std::__is_complete_or_unbounded(
2970 __type_identity<_ArgTypes>{}) && ...),
2971 "each argument type must be a complete class or an unbounded array");
2974 template<
typename _Result,
typename _Ret,
typename =
void>
2975 struct __is_nt_invocable_impl :
false_type { };
2977 template<
typename _Result,
typename _Ret>
2978 struct __is_nt_invocable_impl<_Result, _Ret,
2979 __void_t<typename _Result::type>>
2980 : __or_<is_void<_Ret>,
2981 __is_nothrow_convertible<typename _Result::type, _Ret>>
2985 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2987 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
2988 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2990 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2991 "_Fn must be a complete class or an unbounded array");
2992 static_assert((std::__is_complete_or_unbounded(
2993 __type_identity<_ArgTypes>{}) && ...),
2994 "each argument type must be a complete class or an unbounded array");
2995 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
2996 "_Ret must be a complete class or an unbounded array");
3000 template<
typename _Fn,
typename... _Args>
3004 template<
typename _Fn,
typename... _Args>
3009 template<
typename _Ret,
typename _Fn,
typename... _Args>
3014 template<
typename _Ret,
typename _Fn,
typename... _Args>
3019 #if __cplusplus >= 201703L
3020 # define __cpp_lib_type_trait_variable_templates 201510L
3021 template <
typename _Tp>
3023 template <
typename _Tp>
3025 template <
typename _Tp>
3027 template <
typename _Tp>
3029 template <
typename _Tp>
3031 template <
typename _Tp>
3033 template <
typename _Tp>
3034 inline constexpr
bool is_lvalue_reference_v =
3036 template <
typename _Tp>
3037 inline constexpr
bool is_rvalue_reference_v =
3039 template <
typename _Tp>
3040 inline constexpr
bool is_member_object_pointer_v =
3042 template <
typename _Tp>
3043 inline constexpr
bool is_member_function_pointer_v =
3045 template <
typename _Tp>
3047 template <
typename _Tp>
3049 template <
typename _Tp>
3051 template <
typename _Tp>
3053 template <
typename _Tp>
3055 template <
typename _Tp>
3057 template <
typename _Tp>
3059 template <
typename _Tp>
3061 template <
typename _Tp>
3063 template <
typename _Tp>
3065 template <
typename _Tp>
3067 template <
typename _Tp>
3069 template <
typename _Tp>
3071 template <
typename _Tp>
3073 template <
typename _Tp>
3074 inline constexpr
bool is_trivially_copyable_v =
3075 is_trivially_copyable<_Tp>::value;
3076 template <
typename _Tp>
3078 #pragma GCC diagnostic push
3079 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
3080 template <
typename _Tp>
3081 _GLIBCXX20_DEPRECATED(
"use is_standard_layout_v && is_trivial_v instead")
3082 inline constexpr
bool is_pod_v =
is_pod<_Tp>::value;
3083 template <typename _Tp>
3084 _GLIBCXX17_DEPRECATED
3085 inline constexpr
bool is_literal_type_v =
is_literal_type<_Tp>::value;
3086 #pragma GCC diagnostic pop
3087 template <
typename _Tp>
3089 template <
typename _Tp>
3091 template <
typename _Tp>
3093 template <
typename _Tp>
3095 template <
typename _Tp>
3096 inline constexpr
bool is_signed_v = is_signed<_Tp>::value;
3097 template <
typename _Tp>
3098 inline constexpr
bool is_unsigned_v = is_unsigned<_Tp>::value;
3099 template <
typename _Tp,
typename... _Args>
3100 inline constexpr
bool is_constructible_v =
3102 template <
typename _Tp>
3103 inline constexpr
bool is_default_constructible_v =
3105 template <
typename _Tp>
3106 inline constexpr
bool is_copy_constructible_v =
3108 template <
typename _Tp>
3109 inline constexpr
bool is_move_constructible_v =
3111 template <
typename _Tp,
typename _Up>
3113 template <
typename _Tp>
3115 template <
typename _Tp>
3117 template <
typename _Tp>
3119 template <
typename _Tp,
typename... _Args>
3120 inline constexpr
bool is_trivially_constructible_v =
3122 template <
typename _Tp>
3123 inline constexpr
bool is_trivially_default_constructible_v =
3125 template <
typename _Tp>
3126 inline constexpr
bool is_trivially_copy_constructible_v =
3128 template <
typename _Tp>
3129 inline constexpr
bool is_trivially_move_constructible_v =
3131 template <
typename _Tp,
typename _Up>
3132 inline constexpr
bool is_trivially_assignable_v =
3134 template <
typename _Tp>
3135 inline constexpr
bool is_trivially_copy_assignable_v =
3137 template <
typename _Tp>
3138 inline constexpr
bool is_trivially_move_assignable_v =
3140 template <
typename _Tp>
3141 inline constexpr
bool is_trivially_destructible_v =
3143 template <
typename _Tp,
typename... _Args>
3144 inline constexpr
bool is_nothrow_constructible_v =
3146 template <
typename _Tp>
3147 inline constexpr
bool is_nothrow_default_constructible_v =
3149 template <
typename _Tp>
3150 inline constexpr
bool is_nothrow_copy_constructible_v =
3152 template <
typename _Tp>
3153 inline constexpr
bool is_nothrow_move_constructible_v =
3155 template <
typename _Tp,
typename _Up>
3156 inline constexpr
bool is_nothrow_assignable_v =
3158 template <
typename _Tp>
3159 inline constexpr
bool is_nothrow_copy_assignable_v =
3161 template <
typename _Tp>
3162 inline constexpr
bool is_nothrow_move_assignable_v =
3164 template <
typename _Tp>
3165 inline constexpr
bool is_nothrow_destructible_v =
3167 template <
typename _Tp>
3168 inline constexpr
bool has_virtual_destructor_v =
3170 template <
typename _Tp>
3172 template <
typename _Tp>
3174 template <
typename _Tp,
unsigned _Idx = 0>
3176 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
3177 template <
typename _Tp,
typename _Up>
3178 inline constexpr
bool is_same_v = __is_same(_Tp, _Up);
3180 template <
typename _Tp,
typename _Up>
3183 template <
typename _Base,
typename _Derived>
3185 template <
typename _From,
typename _To>
3188 #ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
3189 # define __cpp_lib_has_unique_object_representations 201606
3191 template<
typename _Tp>
3192 struct has_unique_object_representations
3194 remove_cv_t<remove_all_extents_t<_Tp>>
3197 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3198 "template argument must be a complete class or an unbounded array");
3201 template<
typename _Tp>
3202 inline constexpr
bool has_unique_object_representations_v
3203 = has_unique_object_representations<_Tp>::value;
3206 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
3207 # define __cpp_lib_is_aggregate 201703
3209 template<
typename _Tp>
3211 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3215 template<
typename _Tp>
3216 inline constexpr
bool is_aggregate_v = is_aggregate<_Tp>::value;
3220 #if __cplusplus > 201703L
3221 #define __cpp_lib_remove_cvref 201711L
3224 template<
typename _Tp>
3229 template<
typename _Tp>
3230 struct remove_cvref<_Tp&>
3234 template<
typename _Tp>
3235 struct remove_cvref<_Tp&&>
3239 template<
typename _Tp>
3240 using remove_cvref_t =
typename remove_cvref<_Tp>::type;
3242 #define __cpp_lib_type_identity 201806L
3244 template<
typename _Tp>
3245 struct type_identity {
using type = _Tp; };
3247 template<
typename _Tp>
3248 using type_identity_t =
typename type_identity<_Tp>::type;
3250 #define __cpp_lib_unwrap_ref 201811L
3253 template<
typename _Tp>
3254 struct unwrap_reference {
using type = _Tp; };
3256 template<
typename _Tp>
3257 struct unwrap_reference<reference_wrapper<_Tp>> {
using type = _Tp&; };
3259 template<
typename _Tp>
3260 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3263 template<
typename _Tp>
3264 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
3266 template<
typename _Tp>
3267 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3269 #define __cpp_lib_bounded_array_traits 201902L
3272 template<
typename _Tp>
3273 struct is_bounded_array
3274 :
public __is_array_known_bounds<_Tp>
3278 template<
typename _Tp>
3279 struct is_unbounded_array
3280 :
public __is_array_unknown_bounds<_Tp>
3283 template<
typename _Tp>
3284 inline constexpr
bool is_bounded_array_v
3285 = is_bounded_array<_Tp>::value;
3287 template<
typename _Tp>
3288 inline constexpr
bool is_unbounded_array_v
3289 = is_unbounded_array<_Tp>::value;
3291 #if __cplusplus > 202002L
3292 #define __cpp_lib_is_scoped_enum 202011L
3294 template<
typename _Tp>
3295 struct is_scoped_enum
3299 template<
typename _Tp>
3300 requires __is_enum(_Tp)
3301 && requires(_Tp __t) { __t = __t; }
3302 struct is_scoped_enum<_Tp>
3303 : bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
3308 template<
typename _Tp>
3309 requires __is_enum(_Tp)
3310 && requires(_Tp __t) { __t = __t; }
3311 struct is_scoped_enum<const _Tp>
3312 : bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
3315 template<
typename _Tp>
3316 inline constexpr
bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
3319 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
3321 #define __cpp_lib_is_constant_evaluated 201811L
3323 constexpr
inline bool
3324 is_constant_evaluated() noexcept
3325 {
return __builtin_is_constant_evaluated(); }
3328 template<
typename _From,
typename _To>
3329 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
3331 template<
typename _Xp,
typename _Yp>
3333 = decltype(
false ? declval<_Xp(&)()>()() : declval<_Yp(&)()>()());
3335 template<
typename _Ap,
typename _Bp,
typename =
void>
3336 struct __common_ref_impl
3340 template<
typename _Ap,
typename _Bp>
3341 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
3344 template<
typename _Xp,
typename _Yp>
3345 using __condres_cvref
3346 = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>;
3349 template<
typename _Xp,
typename _Yp>
3350 struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>>
3351 : enable_if<is_reference_v<__condres_cvref<_Xp, _Yp>>,
3352 __condres_cvref<_Xp, _Yp>>
3356 template<
typename _Xp,
typename _Yp>
3357 using __common_ref_C = remove_reference_t<__common_ref<_Xp&, _Yp&>>&&;
3360 template<
typename _Xp,
typename _Yp>
3361 struct __common_ref_impl<_Xp&&, _Yp&&,
3362 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
3363 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
3364 {
using type = __common_ref_C<_Xp, _Yp>; };
3367 template<
typename _Xp,
typename _Yp>
3368 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
3371 template<
typename _Xp,
typename _Yp>
3372 struct __common_ref_impl<_Xp&&, _Yp&,
3373 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
3374 {
using type = __common_ref_D<_Xp, _Yp>; };
3377 template<
typename _Xp,
typename _Yp>
3378 struct __common_ref_impl<_Xp&, _Yp&&>
3379 : __common_ref_impl<_Yp&&, _Xp&>
3382 template<
typename _Tp,
typename _Up,
3383 template<
typename>
class _TQual,
template<
typename>
class _UQual>
3384 struct basic_common_reference
3387 template<
typename _Tp>
3389 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
3391 template<
typename _Tp>
3393 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
3395 template<
typename _Tp>
3396 struct __xref<_Tp&&>
3397 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
3399 template<
typename _Tp1,
typename _Tp2>
3400 using __basic_common_ref
3401 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
3402 remove_cvref_t<_Tp2>,
3403 __xref<_Tp1>::template __type,
3404 __xref<_Tp2>::template __type>::type;
3406 template<
typename... _Tp>
3407 struct common_reference;
3409 template<
typename... _Tp>
3410 using common_reference_t =
typename common_reference<_Tp...>::type;
3414 struct common_reference<>
3418 template<
typename _Tp0>
3419 struct common_reference<_Tp0>
3420 {
using type = _Tp0; };
3422 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1,
typename =
void>
3423 struct __common_reference_impl
3424 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
3428 template<
typename _Tp1,
typename _Tp2>
3429 struct common_reference<_Tp1, _Tp2>
3430 : __common_reference_impl<_Tp1, _Tp2>
3434 template<
typename _Tp1,
typename _Tp2>
3435 struct __common_reference_impl<_Tp1&, _Tp2&, 1,
3436 void_t<__common_ref<_Tp1&, _Tp2&>>>
3437 {
using type = __common_ref<_Tp1&, _Tp2&>; };
3439 template<
typename _Tp1,
typename _Tp2>
3440 struct __common_reference_impl<_Tp1&&, _Tp2&&, 1,
3441 void_t<__common_ref<_Tp1&&, _Tp2&&>>>
3442 {
using type = __common_ref<_Tp1&&, _Tp2&&>; };
3444 template<
typename _Tp1,
typename _Tp2>
3445 struct __common_reference_impl<_Tp1&, _Tp2&&, 1,
3446 void_t<__common_ref<_Tp1&, _Tp2&&>>>
3447 {
using type = __common_ref<_Tp1&, _Tp2&&>; };
3449 template<
typename _Tp1,
typename _Tp2>
3450 struct __common_reference_impl<_Tp1&&, _Tp2&, 1,
3451 void_t<__common_ref<_Tp1&&, _Tp2&>>>
3452 {
using type = __common_ref<_Tp1&&, _Tp2&>; };
3455 template<
typename _Tp1,
typename _Tp2>
3456 struct __common_reference_impl<_Tp1, _Tp2, 2,
3457 void_t<__basic_common_ref<_Tp1, _Tp2>>>
3458 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
3461 template<
typename _Tp1,
typename _Tp2>
3462 struct __common_reference_impl<_Tp1, _Tp2, 3,
3463 void_t<__cond_res<_Tp1, _Tp2>>>
3464 {
using type = __cond_res<_Tp1, _Tp2>; };
3467 template<
typename _Tp1,
typename _Tp2>
3468 struct __common_reference_impl<_Tp1, _Tp2, 4,
3470 {
using type = common_type_t<_Tp1, _Tp2>; };
3473 template<
typename _Tp1,
typename _Tp2>
3474 struct __common_reference_impl<_Tp1, _Tp2, 5, void>
3478 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3479 struct common_reference<_Tp1, _Tp2, _Rest...>
3480 : __common_type_fold<common_reference<_Tp1, _Tp2>,
3481 __common_type_pack<_Rest...>>
3485 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3486 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
3487 __common_type_pack<_Rest...>,
3488 void_t<common_reference_t<_Tp1, _Tp2>>>
3489 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
3494 _GLIBCXX_END_NAMESPACE_VERSION
3499 #endif // _GLIBCXX_TYPE_TRAITS
typename remove_pointer< _Tp >::type remove_pointer_t
Alias template for remove_pointer.
constexpr bool is_invocable_r_v
std::is_invocable_r_v
is_trivially_constructible
constexpr bool is_swappable_with_v
is_swappable_with_v
is_pod (deprecated in C++20)
is_nothrow_default_constructible
typename remove_extent< _Tp >::type remove_extent_t
Alias template for remove_extent.
is_nothrow_copy_assignable
typename remove_const< _Tp >::type remove_const_t
Alias template for remove_const.
typename aligned_storage< _Len, _Align >::type aligned_storage_t
Alias template for aligned_storage.
Provide aligned storage for types.
constexpr bool is_swappable_v
is_swappable_v
std::is_nothrow_invocable_r
__is_nullptr_t (deprecated extension).
Metafunctions used for detecting swappable types: p0185r1.
is_member_function_pointer
typename add_cv< _Tp >::type add_cv_t
Alias template for add_cv.
typename make_unsigned< _Tp >::type make_unsigned_t
Alias template for make_unsigned.
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
typename decay< _Tp >::type decay_t
Alias template for decay.
typename result_of< _Tp >::type result_of_t
Alias template for result_of.
is_nothrow_copy_constructible
constexpr bool is_nothrow_invocable_v
std::is_nothrow_invocable_v
is_trivially_copy_constructible
typename invoke_result< _Fn, _Args...>::type invoke_result_t
std::invoke_result_t
typename add_volatile< _Tp >::type add_volatile_t
Alias template for add_volatile.
The underlying type of an enum.
typename add_rvalue_reference< _Tp >::type add_rvalue_reference_t
Alias template for add_rvalue_reference.
typename remove_all_extents< _Tp >::type remove_all_extents_t
Alias template for remove_all_extents.
typename remove_cv< _Tp >::type remove_cv_t
Alias template for remove_cv.
Define a member typedef type to one of two argument types.
typename conditional< _Cond, _Iftrue, _Iffalse >::type conditional_t
Alias template for conditional.
std::is_nothrow_invocable
typename remove_volatile< _Tp >::type remove_volatile_t
Alias template for remove_volatile.
typename underlying_type< _Tp >::type underlying_type_t
Alias template for underlying_type.
is_nothrow_move_constructible
typename add_const< _Tp >::type add_const_t
Alias template for add_const.
constexpr bool is_nothrow_swappable_with_v
is_nothrow_swappable_with_v
is_null_pointer (LWG 2247).
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
Define a member typedef type only if a boolean constant is true.
Primary class template for reference_wrapper.
is_trivially_copy_assignable
is_trivially_move_constructible
is_trivially_destructible
typename common_type< _Tp...>::type common_type_t
Alias template for common_type.
constexpr bool is_nothrow_invocable_r_v
std::is_nothrow_invocable_r_v
constexpr bool is_invocable_v
std::is_invocable_v
void void_t
A metafunction that always yields void, used for detecting valid types.
aligned_storage< _S_len, alignment_value >::type type
The storage.
is_nothrow_swappable_with
typename make_signed< _Tp >::type make_signed_t
Alias template for make_signed.
typename add_pointer< _Tp >::type add_pointer_t
Alias template for add_pointer.
typename remove_reference< _Tp >::type remove_reference_t
Alias template for remove_reference.
typename add_lvalue_reference< _Tp >::type add_lvalue_reference_t
Alias template for add_lvalue_reference.
constexpr bool is_nothrow_swappable_v
is_nothrow_swappable_v
Implementation of the detection idiom (negative case).
is_trivially_move_assignable
is_nothrow_move_assignable
auto_ptr & operator=(auto_ptr &__a)
auto_ptr assignment operator.
is_trivially_default_constructible