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 _T,
size_t = sizeof(_T)>
201 constexpr
true_type __is_complete_or_unbounded(__type_identity<_T>)
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>
272 #ifdef _GLIBCXX_USE_WCHAR_T
274 struct __is_integral_helper<wchar_t>
278 #ifdef _GLIBCXX_USE_CHAR8_T
280 struct __is_integral_helper<char8_t>
285 struct __is_integral_helper<char16_t>
289 struct __is_integral_helper<char32_t>
293 struct __is_integral_helper<short>
297 struct __is_integral_helper<unsigned short>
301 struct __is_integral_helper<int>
305 struct __is_integral_helper<unsigned int>
309 struct __is_integral_helper<long>
313 struct __is_integral_helper<unsigned long>
317 struct __is_integral_helper<long long>
321 struct __is_integral_helper<unsigned long long>
326 #if defined(__GLIBCXX_TYPE_INT_N_0)
328 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
332 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
335 #if defined(__GLIBCXX_TYPE_INT_N_1)
337 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
341 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
344 #if defined(__GLIBCXX_TYPE_INT_N_2)
346 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
350 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
353 #if defined(__GLIBCXX_TYPE_INT_N_3)
355 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
359 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
364 template<
typename _Tp>
366 :
public __is_integral_helper<__remove_cv_t<_Tp>>
::type
370 struct __is_floating_point_helper
374 struct __is_floating_point_helper<float>
378 struct __is_floating_point_helper<double>
382 struct __is_floating_point_helper<long double>
385 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) && !defined(__CUDACC__)
387 struct __is_floating_point_helper<__float128>
392 template<
typename _Tp>
394 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
402 template<
typename _Tp, std::
size_t _Size>
406 template<
typename _Tp>
407 struct is_array<_Tp[]>
411 struct __is_pointer_helper
414 template<
typename _Tp>
415 struct __is_pointer_helper<_Tp*>
419 template<
typename _Tp>
421 :
public __is_pointer_helper<__remove_cv_t<_Tp>>::type
429 template<
typename _Tp>
438 template<
typename _Tp>
443 struct __is_member_object_pointer_helper
446 template<
typename _Tp,
typename _Cp>
447 struct __is_member_object_pointer_helper<_Tp _Cp::*>
448 :
public __not_<is_function<_Tp>>::type { };
451 template<
typename _Tp>
453 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
457 struct __is_member_function_pointer_helper
460 template<
typename _Tp,
typename _Cp>
461 struct __is_member_function_pointer_helper<_Tp _Cp::*>
462 :
public is_function<_Tp>::type { };
465 template<
typename _Tp>
467 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>
::type
471 template<
typename _Tp>
477 template<
typename _Tp>
483 template<
typename _Tp>
489 template<
typename _Tp>
493 template<
typename _Tp>
494 struct is_function<_Tp&>
497 template<
typename _Tp>
498 struct is_function<_Tp&&>
501 #define __cpp_lib_is_null_pointer 201309
504 struct __is_null_pointer_helper
508 struct __is_null_pointer_helper<
std::nullptr_t>
512 template<
typename _Tp>
514 :
public __is_null_pointer_helper<__remove_cv_t<_Tp>>::type
518 template<
typename _Tp>
521 { } _GLIBCXX_DEPRECATED;
526 template<
typename _Tp>
528 :
public __or_<is_lvalue_reference<_Tp>,
529 is_rvalue_reference<_Tp>>::type
533 template<
typename _Tp>
535 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
539 template<
typename _Tp>
541 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
542 is_null_pointer<_Tp>>::type
546 template<
typename _Tp>
548 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
556 template<
typename _Tp>
558 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
559 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
563 template<
typename _Tp>
565 :
public __not_<is_fundamental<_Tp>>
::type { };
567 template<
typename _Tp>
568 struct __is_member_pointer_helper
571 template<
typename _Tp,
typename _Cp>
572 struct __is_member_pointer_helper<_Tp _Cp::*>
576 template<
typename _Tp>
577 struct is_member_pointer
578 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
581 template<
typename,
typename>
584 template<
typename _Tp,
typename... _Types>
585 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
588 template<
typename _Tp>
589 using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>,
590 signed char,
signed short,
signed int,
signed long,
592 #if defined(__GLIBCXX_TYPE_INT_N_0)
593 ,
signed __GLIBCXX_TYPE_INT_N_0
595 #if defined(__GLIBCXX_TYPE_INT_N_1)
596 ,
signed __GLIBCXX_TYPE_INT_N_1
598 #if defined(__GLIBCXX_TYPE_INT_N_2)
599 ,
signed __GLIBCXX_TYPE_INT_N_2
601 #if defined(__GLIBCXX_TYPE_INT_N_3)
602 ,
signed __GLIBCXX_TYPE_INT_N_3
607 template<
typename _Tp>
608 using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>,
609 unsigned char,
unsigned short,
unsigned int,
unsigned long,
611 #if defined(__GLIBCXX_TYPE_INT_N_0)
612 ,
unsigned __GLIBCXX_TYPE_INT_N_0
614 #if defined(__GLIBCXX_TYPE_INT_N_1)
615 ,
unsigned __GLIBCXX_TYPE_INT_N_1
617 #if defined(__GLIBCXX_TYPE_INT_N_2)
618 ,
unsigned __GLIBCXX_TYPE_INT_N_2
620 #if defined(__GLIBCXX_TYPE_INT_N_3)
621 ,
unsigned __GLIBCXX_TYPE_INT_N_3
627 template<
typename...>
using __void_t = void;
631 template<
typename _Tp,
typename =
void>
632 struct __is_referenceable
636 template<
typename _Tp>
637 struct __is_referenceable<_Tp, __void_t<_Tp&>>
648 template<
typename _Tp>
649 struct is_const<_Tp const>
657 template<
typename _Tp>
662 template<
typename _Tp>
666 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
667 "template argument must be a complete class or an unbounded array");
671 template<
typename _Tp>
672 struct is_trivially_copyable
675 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
676 "template argument must be a complete class or an unbounded array");
680 template<
typename _Tp>
684 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
685 "template argument must be a complete class or an unbounded array");
690 template<
typename _Tp>
692 _GLIBCXX20_DEPRECATED(
"use is_standard_layout && is_trivial instead")
696 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
697 "template argument must be a complete class or an unbounded array");
701 template<
typename _Tp>
705 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
706 "template argument must be a complete class or an unbounded array");
710 template<
typename _Tp>
716 template<
typename _Tp>
721 #if __cplusplus >= 201402L
722 #define __cpp_lib_is_final 201402L
724 template<
typename _Tp>
731 template<
typename _Tp>
736 template<
typename _Tp,
738 struct __is_signed_helper
741 template<
typename _Tp>
742 struct __is_signed_helper<_Tp, true>
743 :
public integral_constant<bool, _Tp(-1) < _Tp(0)>
747 template<typename _Tp>
749 : public __is_signed_helper<_Tp>::type
753 template<typename _Tp>
755 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>
766 template<typename _Tp, typename _Up = _Tp&&>
770 template<typename _Tp>
774 template<typename _Tp>
775 auto declval() noexcept -> decltype(__declval<_Tp>(0));
777 template<typename, unsigned = 0>
783 template<typename _Tp>
784 struct __is_array_known_bounds
788 template<
typename _Tp>
789 struct __is_array_unknown_bounds
790 :
public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
798 struct __do_is_destructible_impl
800 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
807 template<
typename _Tp>
808 struct __is_destructible_impl
809 :
public __do_is_destructible_impl
811 typedef decltype(__test<_Tp>(0)) type;
814 template<typename _Tp,
815 bool = __or_<is_void<_Tp>,
816 __is_array_unknown_bounds<_Tp>,
817 is_function<_Tp>>::value,
818 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
819 struct __is_destructible_safe;
821 template<typename _Tp>
822 struct __is_destructible_safe<_Tp, false, false>
823 : public __is_destructible_impl<typename
824 remove_all_extents<_Tp>::type>::type
827 template<
typename _Tp>
828 struct __is_destructible_safe<_Tp, true, false>
831 template<
typename _Tp>
832 struct __is_destructible_safe<_Tp, false, true>
836 template<
typename _Tp>
838 :
public __is_destructible_safe<_Tp>::type
840 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
841 "template argument must be a complete class or an unbounded array");
848 struct __do_is_nt_destructible_impl
850 template<
typename _Tp>
858 template<
typename _Tp>
859 struct __is_nt_destructible_impl
860 :
public __do_is_nt_destructible_impl
862 typedef decltype(__test<_Tp>(0)) type;
865 template<typename _Tp,
866 bool = __or_<is_void<_Tp>,
867 __is_array_unknown_bounds<_Tp>,
868 is_function<_Tp>>::value,
869 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
870 struct __is_nt_destructible_safe;
872 template<typename _Tp>
873 struct __is_nt_destructible_safe<_Tp, false, false>
874 : public __is_nt_destructible_impl<typename
875 remove_all_extents<_Tp>::type>::type
878 template<
typename _Tp>
879 struct __is_nt_destructible_safe<_Tp, true, false>
882 template<
typename _Tp>
883 struct __is_nt_destructible_safe<_Tp, false, true>
887 template<
typename _Tp>
889 :
public __is_nt_destructible_safe<_Tp>::type
891 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
892 "template argument must be a complete class or an unbounded array");
895 template<
typename _Tp,
typename... _Args>
896 struct __is_constructible_impl
901 template<
typename _Tp,
typename... _Args>
903 :
public __is_constructible_impl<_Tp, _Args...>
905 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
906 "template argument must be a complete class or an unbounded array");
910 template<
typename _Tp>
912 :
public __is_constructible_impl<_Tp>::type
914 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
915 "template argument must be a complete class or an unbounded array");
918 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
919 struct __is_copy_constructible_impl;
921 template<
typename _Tp>
922 struct __is_copy_constructible_impl<_Tp, false>
925 template<
typename _Tp>
926 struct __is_copy_constructible_impl<_Tp, true>
927 :
public __is_constructible_impl<_Tp, const _Tp&>
931 template<
typename _Tp>
933 :
public __is_copy_constructible_impl<_Tp>
935 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
936 "template argument must be a complete class or an unbounded array");
939 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
940 struct __is_move_constructible_impl;
942 template<
typename _Tp>
943 struct __is_move_constructible_impl<_Tp, false>
946 template<
typename _Tp>
947 struct __is_move_constructible_impl<_Tp, true>
948 :
public __is_constructible_impl<_Tp, _Tp&&>
952 template<
typename _Tp>
954 :
public __is_move_constructible_impl<_Tp>
956 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
957 "template argument must be a complete class or an unbounded array");
960 template<
typename _Tp>
961 struct __is_nt_default_constructible_atom
965 template<typename _Tp, bool = is_array<_Tp>::value>
966 struct __is_nt_default_constructible_impl;
968 template<
typename _Tp>
969 struct __is_nt_default_constructible_impl<_Tp, true>
970 :
public __and_<__is_array_known_bounds<_Tp>,
971 __is_nt_default_constructible_atom<typename
972 remove_all_extents<_Tp>::type>>
975 template<
typename _Tp>
976 struct __is_nt_default_constructible_impl<_Tp, false>
977 :
public __is_nt_default_constructible_atom<_Tp>
980 template<
typename _Tp>
981 using __is_nothrow_default_constructible_impl
982 = __and_<__is_constructible_impl<_Tp>,
983 __is_nt_default_constructible_impl<_Tp>>;
986 template<
typename _Tp>
988 :
public __is_nothrow_default_constructible_impl<_Tp>::type
990 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
991 "template argument must be a complete class or an unbounded array");
994 template<
typename _Tp,
typename... _Args>
995 struct __is_nt_constructible_impl
999 template<
typename _Tp,
typename _Arg>
1000 struct __is_nt_constructible_impl<_Tp, _Arg>
1001 :
public integral_constant<bool,
1002 noexcept(static_cast<_Tp>(declval<_Arg>()))>
1005 template<
typename _Tp>
1006 struct __is_nt_constructible_impl<_Tp>
1007 :
public __is_nothrow_default_constructible_impl<_Tp>
1010 template<
typename _Tp,
typename... _Args>
1011 struct __is_nothrow_constructible_impl
1012 :
public __and_<__is_constructible_impl<_Tp, _Args...>,
1013 __is_nt_constructible_impl<_Tp, _Args...>>
1017 template<
typename _Tp,
typename... _Args>
1019 :
public __is_nothrow_constructible_impl<_Tp, _Args...>::type
1021 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1022 "template argument must be a complete class or an unbounded array");
1025 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1026 struct __is_nothrow_copy_constructible_impl;
1028 template<
typename _Tp>
1029 struct __is_nothrow_copy_constructible_impl<_Tp, false>
1032 template<
typename _Tp>
1033 struct __is_nothrow_copy_constructible_impl<_Tp, true>
1034 :
public __is_nothrow_constructible_impl<_Tp, const _Tp&>
1038 template<
typename _Tp>
1040 :
public __is_nothrow_copy_constructible_impl<_Tp>::type
1042 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1043 "template argument must be a complete class or an unbounded array");
1046 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1047 struct __is_nothrow_move_constructible_impl;
1049 template<
typename _Tp>
1050 struct __is_nothrow_move_constructible_impl<_Tp, false>
1053 template<
typename _Tp>
1054 struct __is_nothrow_move_constructible_impl<_Tp, true>
1055 :
public __is_nothrow_constructible_impl<_Tp, _Tp&&>
1059 template<
typename _Tp>
1061 :
public __is_nothrow_move_constructible_impl<_Tp>::type
1063 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1064 "template argument must be a complete class or an unbounded array");
1068 template<
typename _Tp,
typename _Up>
1072 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1073 "template argument must be a complete class or an unbounded array");
1076 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1077 struct __is_copy_assignable_impl;
1079 template<
typename _Tp>
1080 struct __is_copy_assignable_impl<_Tp, false>
1083 template<
typename _Tp>
1084 struct __is_copy_assignable_impl<_Tp, true>
1085 :
public __bool_constant<__is_assignable(_Tp&, const _Tp&)>
1089 template<
typename _Tp>
1091 :
public __is_copy_assignable_impl<_Tp>::type
1093 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1094 "template argument must be a complete class or an unbounded array");
1097 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1098 struct __is_move_assignable_impl;
1100 template<
typename _Tp>
1101 struct __is_move_assignable_impl<_Tp, false>
1104 template<
typename _Tp>
1105 struct __is_move_assignable_impl<_Tp, true>
1106 :
public __bool_constant<__is_assignable(_Tp&, _Tp&&)>
1110 template<
typename _Tp>
1112 :
public __is_move_assignable_impl<_Tp>::type
1114 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1115 "template argument must be a complete class or an unbounded array");
1118 template<
typename _Tp,
typename _Up>
1119 struct __is_nt_assignable_impl
1123 template<
typename _Tp,
typename _Up>
1124 struct __is_nothrow_assignable_impl
1125 :
public __and_<__bool_constant<__is_assignable(_Tp, _Up)>,
1126 __is_nt_assignable_impl<_Tp, _Up>>
1130 template<
typename _Tp,
typename _Up>
1132 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1134 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1135 "template argument must be a complete class or an unbounded array");
1138 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1139 struct __is_nt_copy_assignable_impl;
1141 template<
typename _Tp>
1142 struct __is_nt_copy_assignable_impl<_Tp, false>
1145 template<
typename _Tp>
1146 struct __is_nt_copy_assignable_impl<_Tp, true>
1147 :
public __is_nothrow_assignable_impl<_Tp&, const _Tp&>
1151 template<
typename _Tp>
1153 :
public __is_nt_copy_assignable_impl<_Tp>
1155 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1156 "template argument must be a complete class or an unbounded array");
1159 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1160 struct __is_nt_move_assignable_impl;
1162 template<
typename _Tp>
1163 struct __is_nt_move_assignable_impl<_Tp, false>
1166 template<
typename _Tp>
1167 struct __is_nt_move_assignable_impl<_Tp, true>
1168 :
public __is_nothrow_assignable_impl<_Tp&, _Tp&&>
1172 template<
typename _Tp>
1174 :
public __is_nt_move_assignable_impl<_Tp>
1176 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1177 "template argument must be a complete class or an unbounded array");
1181 template<
typename _Tp,
typename... _Args>
1185 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1186 "template argument must be a complete class or an unbounded array");
1190 template<
typename _Tp>
1194 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1195 "template argument must be a complete class or an unbounded array");
1198 struct __do_is_implicitly_default_constructible_impl
1200 template <
typename _Tp>
1201 static void __helper(
const _Tp&);
1203 template <
typename _Tp>
1205 decltype(__helper<const _Tp&>({}))* = 0);
1210 template<
typename _Tp>
1211 struct __is_implicitly_default_constructible_impl
1212 :
public __do_is_implicitly_default_constructible_impl
1214 typedef decltype(__test(declval<_Tp>())) type;
1217 template<typename _Tp>
1218 struct __is_implicitly_default_constructible_safe
1219 : public __is_implicitly_default_constructible_impl<_Tp>::type
1222 template <
typename _Tp>
1223 struct __is_implicitly_default_constructible
1224 :
public __and_<__is_constructible_impl<_Tp>,
1225 __is_implicitly_default_constructible_safe<_Tp>>
1228 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1229 struct __is_trivially_copy_constructible_impl;
1231 template<
typename _Tp>
1232 struct __is_trivially_copy_constructible_impl<_Tp, false>
1235 template<
typename _Tp>
1236 struct __is_trivially_copy_constructible_impl<_Tp, true>
1237 :
public __and_<__is_copy_constructible_impl<_Tp>,
1238 integral_constant<bool,
1239 __is_trivially_constructible(_Tp, const _Tp&)>>
1243 template<
typename _Tp>
1245 :
public __is_trivially_copy_constructible_impl<_Tp>
1247 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1248 "template argument must be a complete class or an unbounded array");
1251 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1252 struct __is_trivially_move_constructible_impl;
1254 template<
typename _Tp>
1255 struct __is_trivially_move_constructible_impl<_Tp, false>
1258 template<
typename _Tp>
1259 struct __is_trivially_move_constructible_impl<_Tp, true>
1260 :
public __and_<__is_move_constructible_impl<_Tp>,
1261 integral_constant<bool,
1262 __is_trivially_constructible(_Tp, _Tp&&)>>
1266 template<
typename _Tp>
1268 :
public __is_trivially_move_constructible_impl<_Tp>
1270 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1271 "template argument must be a complete class or an unbounded array");
1275 template<
typename _Tp,
typename _Up>
1279 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1280 "template argument must be a complete class or an unbounded array");
1283 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1284 struct __is_trivially_copy_assignable_impl;
1286 template<
typename _Tp>
1287 struct __is_trivially_copy_assignable_impl<_Tp, false>
1290 template<
typename _Tp>
1291 struct __is_trivially_copy_assignable_impl<_Tp, true>
1292 :
public __bool_constant<__is_trivially_assignable(_Tp&, const _Tp&)>
1296 template<
typename _Tp>
1298 :
public __is_trivially_copy_assignable_impl<_Tp>
1300 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1301 "template argument must be a complete class or an unbounded array");
1304 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1305 struct __is_trivially_move_assignable_impl;
1307 template<
typename _Tp>
1308 struct __is_trivially_move_assignable_impl<_Tp, false>
1311 template<
typename _Tp>
1312 struct __is_trivially_move_assignable_impl<_Tp, true>
1313 :
public __bool_constant<__is_trivially_assignable(_Tp&, _Tp&&)>
1317 template<
typename _Tp>
1319 :
public __is_trivially_move_assignable_impl<_Tp>
1321 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1322 "template argument must be a complete class or an unbounded array");
1326 template<
typename _Tp>
1328 :
public __and_<__is_destructible_safe<_Tp>,
1329 __bool_constant<__has_trivial_destructor(_Tp)>>
1331 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1332 "template argument must be a complete class or an unbounded array");
1337 template<
typename _Tp>
1341 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1342 "template argument must be a complete class or an unbounded array");
1349 template<
typename _Tp>
1353 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1354 "template argument must be a complete class or an unbounded array");
1362 template<
typename _Tp, std::
size_t _Size>
1363 struct rank<_Tp[_Size]>
1366 template<
typename _Tp>
1368 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1371 template<
typename,
unsigned _U
int>
1373 :
public integral_constant<std::size_t, 0> { };
1375 template<
typename _Tp,
unsigned _U
int, std::
size_t _Size>
1376 struct extent<_Tp[_Size], _Uint>
1377 :
public integral_constant<std::size_t,
1378 _Uint == 0 ? _Size : extent<_Tp,
1382 template<
typename _Tp,
unsigned _U
int>
1383 struct extent<_Tp[], _Uint>
1384 :
public integral_constant<std::size_t,
1385 _Uint == 0 ? 0 : extent<_Tp,
1393 template<
typename _Tp,
typename _Up>
1395 #ifdef _GLIBCXX_BUILTIN_IS_SAME_AS
1396 :
public integral_constant<bool, _GLIBCXX_BUILTIN_IS_SAME_AS(_Tp, _Up)>
1402 #ifndef _GLIBCXX_BUILTIN_IS_SAME_AS
1403 template<
typename _Tp>
1404 struct is_same<_Tp, _Tp>
1410 template<
typename _Base,
typename _Derived>
1415 template<
typename _From,
typename _To,
1418 struct __is_convertible_helper
1423 #pragma GCC diagnostic push
1424 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1425 template<
typename _From,
typename _To>
1426 class __is_convertible_helper<_From, _To, false>
1428 template<
typename _To1>
1429 static void __test_aux(_To1) noexcept;
1431 template<
typename _From1,
typename _To1,
1432 typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
1436 template<
typename,
typename>
1441 typedef decltype(__test<_From, _To>(0)) type;
1443 #pragma GCC diagnostic pop
1446 template<
typename _From,
typename _To>
1448 :
public __is_convertible_helper<_From, _To>::type
1451 template<
typename _From,
typename _To,
1454 struct __is_nt_convertible_helper
1458 #pragma GCC diagnostic push
1459 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1460 template<
typename _From,
typename _To>
1461 class __is_nt_convertible_helper<_From, _To, false>
1463 template<
typename _To1>
1464 static void __test_aux(_To1) noexcept;
1466 template<
typename _From1,
typename _To1>
1468 __bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))>
1471 template<
typename,
typename>
1476 using type = decltype(__test<_From, _To>(0));
1478 #pragma GCC diagnostic pop
1481 template<
typename _ToElementType,
typename _FromElementType>
1482 using __is_array_convertible
1483 = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
1486 template<
typename _From,
typename _To>
1487 struct __is_nothrow_convertible
1488 :
public __is_nt_convertible_helper<_From, _To>::type
1491 #if __cplusplus > 201703L
1493 template<
typename _From,
typename _To>
1494 struct is_nothrow_convertible
1495 :
public __is_nt_convertible_helper<_From, _To>::type
1499 template<
typename _From,
typename _To>
1500 inline constexpr
bool is_nothrow_convertible_v
1501 = is_nothrow_convertible<_From, _To>::value;
1507 template<
typename _Tp>
1509 {
typedef _Tp type; };
1511 template<
typename _Tp>
1513 {
typedef _Tp type; };
1516 template<
typename _Tp>
1518 {
typedef _Tp type; };
1520 template<
typename _Tp>
1522 {
typedef _Tp type; };
1525 template<
typename _Tp>
1527 {
using type = _Tp; };
1529 template<
typename _Tp>
1530 struct remove_cv<const _Tp>
1531 {
using type = _Tp; };
1533 template<
typename _Tp>
1534 struct remove_cv<volatile _Tp>
1535 {
using type = _Tp; };
1537 template<
typename _Tp>
1538 struct remove_cv<const volatile _Tp>
1539 {
using type = _Tp; };
1542 template<
typename _Tp>
1544 {
typedef _Tp
const type; };
1547 template<
typename _Tp>
1549 {
typedef _Tp
volatile type; };
1552 template<
typename _Tp>
1559 #if __cplusplus > 201103L
1561 #define __cpp_lib_transformation_trait_aliases 201304
1564 template<
typename _Tp>
1568 template<
typename _Tp>
1572 template<
typename _Tp>
1576 template<
typename _Tp>
1580 template<
typename _Tp>
1584 template<
typename _Tp>
1591 template<
typename _Tp>
1593 {
typedef _Tp type; };
1595 template<
typename _Tp>
1597 {
typedef _Tp type; };
1599 template<
typename _Tp>
1600 struct remove_reference<_Tp&&>
1601 {
typedef _Tp type; };
1603 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1604 struct __add_lvalue_reference_helper
1605 {
typedef _Tp type; };
1607 template<
typename _Tp>
1608 struct __add_lvalue_reference_helper<_Tp, true>
1609 {
typedef _Tp& type; };
1612 template<
typename _Tp>
1614 :
public __add_lvalue_reference_helper<_Tp>
1617 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1618 struct __add_rvalue_reference_helper
1619 {
typedef _Tp type; };
1621 template<
typename _Tp>
1622 struct __add_rvalue_reference_helper<_Tp, true>
1623 {
typedef _Tp&& type; };
1626 template<
typename _Tp>
1628 :
public __add_rvalue_reference_helper<_Tp>
1631 #if __cplusplus > 201103L
1633 template<
typename _Tp>
1637 template<
typename _Tp>
1641 template<
typename _Tp>
1648 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1649 struct __cv_selector;
1651 template<
typename _Unqualified>
1652 struct __cv_selector<_Unqualified, false, false>
1653 {
typedef _Unqualified __type; };
1655 template<
typename _Unqualified>
1656 struct __cv_selector<_Unqualified, false, true>
1657 {
typedef volatile _Unqualified __type; };
1659 template<
typename _Unqualified>
1660 struct __cv_selector<_Unqualified, true, false>
1661 {
typedef const _Unqualified __type; };
1663 template<
typename _Unqualified>
1664 struct __cv_selector<_Unqualified, true, true>
1665 {
typedef const volatile _Unqualified __type; };
1667 template<
typename _Qualified,
typename _Unqualified,
1668 bool _IsConst = is_const<_Qualified>::value,
1669 bool _IsVol = is_volatile<_Qualified>::value>
1670 class __match_cv_qualifiers
1672 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1675 typedef typename __match::__type __type;
1679 template<
typename _Tp>
1680 struct __make_unsigned
1681 {
typedef _Tp __type; };
1684 struct __make_unsigned<char>
1685 {
typedef unsigned char __type; };
1688 struct __make_unsigned<signed char>
1689 {
typedef unsigned char __type; };
1692 struct __make_unsigned<short>
1693 {
typedef unsigned short __type; };
1696 struct __make_unsigned<int>
1697 {
typedef unsigned int __type; };
1700 struct __make_unsigned<long>
1701 {
typedef unsigned long __type; };
1704 struct __make_unsigned<long long>
1705 {
typedef unsigned long long __type; };
1707 #if defined(__GLIBCXX_TYPE_INT_N_0)
1709 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1710 {
typedef unsigned __GLIBCXX_TYPE_INT_N_0 __type; };
1712 #if defined(__GLIBCXX_TYPE_INT_N_1)
1714 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1715 {
typedef unsigned __GLIBCXX_TYPE_INT_N_1 __type; };
1717 #if defined(__GLIBCXX_TYPE_INT_N_2)
1719 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1720 {
typedef unsigned __GLIBCXX_TYPE_INT_N_2 __type; };
1722 #if defined(__GLIBCXX_TYPE_INT_N_3)
1724 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1725 {
typedef unsigned __GLIBCXX_TYPE_INT_N_3 __type; };
1729 template<
typename _Tp,
1730 bool _IsInt = is_integral<_Tp>::value,
1731 bool _IsEnum = is_enum<_Tp>::value>
1732 class __make_unsigned_selector;
1734 template<
typename _Tp>
1735 class __make_unsigned_selector<_Tp, true, false>
1737 using __unsigned_type
1738 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
1742 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1745 class __make_unsigned_selector_base
1748 template<
typename...>
struct _List { };
1750 template<
typename _Tp,
typename... _Up>
1751 struct _List<_Tp, _Up...> : _List<_Up...>
1752 {
static constexpr
size_t __size =
sizeof(_Tp); };
1754 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
1757 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
1758 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
1759 {
using __type = _Uint; };
1761 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
1762 struct __select<_Sz, _List<_Uint, _UInts...>, false>
1763 : __select<_Sz, _List<_UInts...>>
1768 template<
typename _Tp>
1769 class __make_unsigned_selector<_Tp, false, true>
1770 : __make_unsigned_selector_base
1773 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
1774 unsigned long,
unsigned long long>;
1776 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
1780 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1787 #if defined(_GLIBCXX_USE_WCHAR_T)
1789 struct __make_unsigned<wchar_t>
1792 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
1796 #ifdef _GLIBCXX_USE_CHAR8_T
1798 struct __make_unsigned<char8_t>
1801 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
1806 struct __make_unsigned<char16_t>
1809 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
1813 struct __make_unsigned<char32_t>
1816 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
1823 template<
typename _Tp>
1825 {
typedef typename __make_unsigned_selector<_Tp>::__type type; };
1833 template<
typename _Tp>
1834 struct __make_signed
1835 {
typedef _Tp __type; };
1838 struct __make_signed<char>
1839 {
typedef signed char __type; };
1842 struct __make_signed<unsigned char>
1843 {
typedef signed char __type; };
1846 struct __make_signed<unsigned short>
1847 {
typedef signed short __type; };
1850 struct __make_signed<unsigned int>
1851 {
typedef signed int __type; };
1854 struct __make_signed<unsigned long>
1855 {
typedef signed long __type; };
1858 struct __make_signed<unsigned long long>
1859 {
typedef signed long long __type; };
1861 #if defined(__GLIBCXX_TYPE_INT_N_0)
1863 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
1864 {
typedef __GLIBCXX_TYPE_INT_N_0 __type; };
1866 #if defined(__GLIBCXX_TYPE_INT_N_1)
1868 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
1869 {
typedef __GLIBCXX_TYPE_INT_N_1 __type; };
1871 #if defined(__GLIBCXX_TYPE_INT_N_2)
1873 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
1874 {
typedef __GLIBCXX_TYPE_INT_N_2 __type; };
1876 #if defined(__GLIBCXX_TYPE_INT_N_3)
1878 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
1879 {
typedef __GLIBCXX_TYPE_INT_N_3 __type; };
1883 template<
typename _Tp,
1884 bool _IsInt = is_integral<_Tp>::value,
1885 bool _IsEnum = is_enum<_Tp>::value>
1886 class __make_signed_selector;
1888 template<
typename _Tp>
1889 class __make_signed_selector<_Tp, true, false>
1892 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
1896 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
1900 template<
typename _Tp>
1901 class __make_signed_selector<_Tp, false, true>
1903 typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
1906 typedef typename __make_signed_selector<__unsigned_type>::__type __type;
1913 #if defined(_GLIBCXX_USE_WCHAR_T)
1915 struct __make_signed<wchar_t>
1918 =
typename __make_signed_selector<wchar_t, false, true>::__type;
1922 #if defined(_GLIBCXX_USE_CHAR8_T)
1924 struct __make_signed<char8_t>
1927 =
typename __make_signed_selector<char8_t, false, true>::__type;
1932 struct __make_signed<char16_t>
1935 =
typename __make_signed_selector<char16_t, false, true>::__type;
1939 struct __make_signed<char32_t>
1942 =
typename __make_signed_selector<char32_t, false, true>::__type;
1949 template<
typename _Tp>
1951 {
typedef typename __make_signed_selector<_Tp>::__type type; };
1957 #if __cplusplus > 201103L
1959 template<
typename _Tp>
1963 template<
typename _Tp>
1970 template<
typename _Tp>
1972 {
typedef _Tp type; };
1974 template<
typename _Tp, std::
size_t _Size>
1976 {
typedef _Tp type; };
1978 template<
typename _Tp>
1979 struct remove_extent<_Tp[]>
1980 {
typedef _Tp type; };
1983 template<
typename _Tp>
1984 struct remove_all_extents
1985 {
typedef _Tp type; };
1987 template<
typename _Tp, std::
size_t _Size>
1988 struct remove_all_extents<_Tp[_Size]>
1989 {
typedef typename remove_all_extents<_Tp>::type type; };
1991 template<
typename _Tp>
1992 struct remove_all_extents<_Tp[]>
1993 {
typedef typename remove_all_extents<_Tp>::type type; };
1995 #if __cplusplus > 201103L
1997 template<
typename _Tp>
2001 template<
typename _Tp>
2007 template<
typename _Tp,
typename>
2008 struct __remove_pointer_helper
2009 {
typedef _Tp type; };
2011 template<
typename _Tp,
typename _Up>
2012 struct __remove_pointer_helper<_Tp, _Up*>
2013 {
typedef _Up type; };
2016 template<
typename _Tp>
2018 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2022 template<
typename _Tp,
bool = __or_<__is_referenceable<_Tp>,
2023 is_
void<_Tp>>::value>
2025 {
typedef _Tp type; };
2027 template<
typename _Tp>
2029 {
typedef typename remove_reference<_Tp>::type* type; };
2031 template<
typename _Tp>
2033 :
public __add_pointer_helper<_Tp>
2036 #if __cplusplus > 201103L
2038 template<
typename _Tp>
2042 template<
typename _Tp>
2046 template<std::
size_t _Len>
2047 struct __aligned_storage_msa
2051 unsigned char __data[_Len];
2052 struct __attribute__((__aligned__)) { } __align;
2066 template<std::size_t _Len, std::size_t _Align =
2067 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2072 unsigned char __data[_Len];
2073 struct __attribute__((__aligned__((_Align)))) { } __align;
2077 template <
typename... _Types>
2078 struct __strictest_alignment
2080 static const size_t _S_alignment = 0;
2081 static const size_t _S_size = 0;
2084 template <
typename _Tp,
typename... _Types>
2085 struct __strictest_alignment<_Tp, _Types...>
2087 static const size_t _S_alignment =
2088 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2089 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2090 static const size_t _S_size =
2091 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2092 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2105 template <
size_t _Len,
typename... _Types>
2109 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2111 using __strictest = __strictest_alignment<_Types...>;
2112 static const size_t _S_len = _Len > __strictest::_S_size
2113 ? _Len : __strictest::_S_size;
2116 static const size_t alignment_value = __strictest::_S_alignment;
2121 template <
size_t _Len,
typename... _Types>
2122 const size_t aligned_union<_Len, _Types...>::alignment_value;
2126 template<
typename _Up,
2129 struct __decay_selector;
2132 template<
typename _Up>
2133 struct __decay_selector<_Up, false, false>
2134 {
typedef __remove_cv_t<_Up> __type; };
2136 template<
typename _Up>
2137 struct __decay_selector<_Up, true, false>
2138 {
typedef typename remove_extent<_Up>::type* __type; };
2140 template<
typename _Up>
2141 struct __decay_selector<_Up, false, true>
2142 {
typedef typename add_pointer<_Up>::type __type; };
2145 template<
typename _Tp>
2148 typedef typename remove_reference<_Tp>::type __remove_type;
2151 typedef typename __decay_selector<__remove_type>::__type type;
2155 template<
typename _Tp>
2156 using __decay_t =
typename decay<_Tp>::type;
2158 template<
typename _Tp>
2162 template<
typename _Tp>
2163 struct __strip_reference_wrapper
2168 template<
typename _Tp>
2171 typedef _Tp& __type;
2174 template<
typename _Tp>
2175 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2180 template<
bool,
typename _Tp =
void>
2185 template<
typename _Tp>
2187 {
typedef _Tp type; };
2190 template<
bool _Cond,
typename _Tp =
void>
2191 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
2193 template<
typename... _Cond>
2194 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2198 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2200 {
typedef _Iftrue type; };
2203 template<
typename _Iftrue,
typename _Iffalse>
2204 struct conditional<false, _Iftrue, _Iffalse>
2205 {
typedef _Iffalse type; };
2208 template<
typename _Tp>
2209 using __remove_cvref_t
2210 =
typename remove_cv<typename remove_reference<_Tp>::type>::type;
2213 template<
typename... _Tp>
2218 struct __do_common_type_impl
2220 template<
typename _Tp,
typename _Up>
2222 = decltype(
true ? std::declval<_Tp>() : std::declval<_Up>());
2226 template<
typename _Tp,
typename _Up>
2227 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2230 #if __cplusplus > 201703L
2233 template<
typename _Tp,
typename _Up>
2234 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2238 template<
typename,
typename>
2239 static __failure_type
2242 template<
typename _Tp,
typename _Up>
2243 static decltype(_S_test_2<_Tp, _Up>(0))
2253 template<
typename _Tp0>
2259 template<
typename _Tp1,
typename _Tp2,
2260 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2261 struct __common_type_impl
2265 using type = common_type<_Dp1, _Dp2>;
2268 template<
typename _Tp1,
typename _Tp2>
2269 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2270 :
private __do_common_type_impl
2274 using type = decltype(_S_test<_Tp1, _Tp2>(0));
2278 template<
typename _Tp1,
typename _Tp2>
2279 struct common_type<_Tp1, _Tp2>
2280 :
public __common_type_impl<_Tp1, _Tp2>::type
2283 template<
typename...>
2284 struct __common_type_pack
2287 template<
typename,
typename,
typename =
void>
2288 struct __common_type_fold;
2291 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2292 struct common_type<_Tp1, _Tp2, _Rp...>
2293 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2294 __common_type_pack<_Rp...>>
2300 template<
typename _CTp,
typename... _Rp>
2301 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2302 __void_t<typename _CTp::type>>
2303 :
public common_type<typename _CTp::type, _Rp...>
2307 template<
typename _CTp,
typename _Rp>
2308 struct __common_type_fold<_CTp, _Rp, void>
2311 template<typename _Tp, bool = is_enum<_Tp>::value>
2312 struct __underlying_type_impl
2314 using type = __underlying_type(_Tp);
2317 template<
typename _Tp>
2318 struct __underlying_type_impl<_Tp, false>
2322 template<
typename _Tp>
2324 :
public __underlying_type_impl<_Tp>
2327 template<
typename _Tp>
2328 struct __declval_protector
2330 static const bool __stop =
false;
2333 template<
typename _Tp>
2334 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2336 static_assert(__declval_protector<_Tp>::__stop,
2337 "declval() must not be used!");
2338 return __declval<_Tp>(0);
2342 template<
typename _Signature>
2347 #define __cpp_lib_result_of_sfinae 201210
2349 struct __invoke_memfun_ref { };
2350 struct __invoke_memfun_deref { };
2351 struct __invoke_memobj_ref { };
2352 struct __invoke_memobj_deref { };
2353 struct __invoke_other { };
2356 template<
typename _Tp,
typename _Tag>
2357 struct __result_of_success : __success_type<_Tp>
2358 {
using __invoke_type = _Tag; };
2361 struct __result_of_memfun_ref_impl
2363 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2364 static __result_of_success<decltype(
2365 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2366 ), __invoke_memfun_ref> _S_test(
int);
2368 template<
typename...>
2369 static __failure_type _S_test(...);
2372 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2373 struct __result_of_memfun_ref
2374 :
private __result_of_memfun_ref_impl
2376 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2380 struct __result_of_memfun_deref_impl
2382 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2383 static __result_of_success<decltype(
2384 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2385 ), __invoke_memfun_deref> _S_test(
int);
2387 template<
typename...>
2388 static __failure_type _S_test(...);
2391 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2392 struct __result_of_memfun_deref
2393 :
private __result_of_memfun_deref_impl
2395 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2399 struct __result_of_memobj_ref_impl
2401 template<
typename _Fp,
typename _Tp1>
2402 static __result_of_success<decltype(
2403 std::declval<_Tp1>().*std::declval<_Fp>()
2404 ), __invoke_memobj_ref> _S_test(
int);
2406 template<
typename,
typename>
2407 static __failure_type _S_test(...);
2410 template<
typename _MemPtr,
typename _Arg>
2411 struct __result_of_memobj_ref
2412 :
private __result_of_memobj_ref_impl
2414 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2418 struct __result_of_memobj_deref_impl
2420 template<
typename _Fp,
typename _Tp1>
2421 static __result_of_success<decltype(
2422 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2423 ), __invoke_memobj_deref> _S_test(
int);
2425 template<
typename,
typename>
2426 static __failure_type _S_test(...);
2429 template<
typename _MemPtr,
typename _Arg>
2430 struct __result_of_memobj_deref
2431 :
private __result_of_memobj_deref_impl
2433 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2436 template<typename _MemPtr, typename _Arg>
2437 struct __result_of_memobj;
2439 template<typename _Res, typename _Class, typename _Arg>
2440 struct __result_of_memobj<_Res _Class::*, _Arg>
2442 typedef __remove_cvref_t<_Arg> _Argval;
2443 typedef _Res _Class::* _MemPtr;
2444 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2445 is_base_of<_Class, _Argval>>::value,
2446 __result_of_memobj_ref<_MemPtr, _Arg>,
2447 __result_of_memobj_deref<_MemPtr, _Arg>
2451 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2452 struct __result_of_memfun;
2454 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2455 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2457 typedef typename remove_reference<_Arg>::type _Argval;
2458 typedef _Res _Class::* _MemPtr;
2459 typedef typename conditional<is_base_of<_Class, _Argval>::value,
2460 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2461 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2470 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2476 template<
typename _Tp,
typename _Up>
2477 struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
2482 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2483 struct __result_of_impl
2485 typedef __failure_type type;
2488 template<
typename _MemPtr,
typename _Arg>
2489 struct __result_of_impl<true, false, _MemPtr, _Arg>
2490 :
public __result_of_memobj<__decay_t<_MemPtr>,
2491 typename __inv_unwrap<_Arg>::type>
2494 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2495 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2496 :
public __result_of_memfun<__decay_t<_MemPtr>,
2497 typename __inv_unwrap<_Arg>::type, _Args...>
2501 struct __result_of_other_impl
2503 template<
typename _Fn,
typename... _Args>
2504 static __result_of_success<decltype(
2505 std::declval<_Fn>()(std::declval<_Args>()...)
2506 ), __invoke_other> _S_test(
int);
2508 template<
typename...>
2509 static __failure_type _S_test(...);
2512 template<
typename _Functor,
typename... _ArgTypes>
2513 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2514 :
private __result_of_other_impl
2516 typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2520 template<typename _Functor, typename... _ArgTypes>
2521 struct __invoke_result
2522 : public __result_of_impl<
2523 is_member_object_pointer<
2524 typename remove_reference<_Functor>::type
2526 is_member_function_pointer<
2527 typename remove_reference<_Functor>::type
2529 _Functor, _ArgTypes...
2533 template<
typename _Functor,
typename... _ArgTypes>
2534 struct result_of<_Functor(_ArgTypes...)>
2535 :
public __invoke_result<_Functor, _ArgTypes...>
2538 #if __cplusplus >= 201402L
2540 template<
size_t _Len,
size_t _Align =
2541 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2544 template <
size_t _Len,
typename... _Types>
2545 using aligned_union_t =
typename aligned_union<_Len, _Types...>::type;
2548 template<
typename _Tp>
2552 template<
bool _Cond,
typename _Tp =
void>
2556 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2560 template<
typename... _Tp>
2564 template<
typename _Tp>
2568 template<
typename _Tp>
2572 #if __cplusplus >= 201703L || !defined(__STRICT_ANSI__) // c++17 or gnu++11
2573 #define __cpp_lib_void_t 201411
2579 template<
typename _Default,
typename _AlwaysVoid,
2580 template<
typename...>
class _Op,
typename... _Args>
2584 using type = _Default;
2588 template<
typename _Default,
template<
typename...>
class _Op,
2590 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2593 using type = _Op<_Args...>;
2597 template<
typename _Default,
template<
typename...>
class _Op,
2602 template<
typename _Default,
template<
typename...>
class _Op,
2604 using __detected_or_t
2613 #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2614 template<typename _Tp, typename = __void_t<>> \
2615 struct __has_##_NTYPE \
2618 template<typename _Tp> \
2619 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
2623 template <
typename _Tp>
2624 struct __is_swappable;
2626 template <
typename _Tp>
2627 struct __is_nothrow_swappable;
2629 template<
typename... _Elements>
2636 template<
typename... _Tps>
2637 struct __is_tuple_like_impl<tuple<_Tps...>> :
true_type
2641 template<
typename _Tp>
2642 struct __is_tuple_like
2643 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
2646 template<
typename _Tp>
2647 _GLIBCXX20_CONSTEXPR
2649 _Require<__not_<__is_tuple_like<_Tp>>,
2650 is_move_constructible<_Tp>,
2651 is_move_assignable<_Tp>>
2653 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2654 is_nothrow_move_assignable<_Tp>>::value);
2656 template<
typename _Tp,
size_t _Nm>
2657 _GLIBCXX20_CONSTEXPR
2659 __enable_if_t<__is_swappable<_Tp>::value>
2660 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2661 noexcept(__is_nothrow_swappable<_Tp>::value);
2663 namespace __swappable_details {
2666 struct __do_is_swappable_impl
2668 template<
typename _Tp,
typename
2669 = decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2676 struct __do_is_nothrow_swappable_impl
2678 template<
typename _Tp>
2679 static __bool_constant<
2680 noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2689 template<
typename _Tp>
2690 struct __is_swappable_impl
2691 :
public __swappable_details::__do_is_swappable_impl
2693 typedef decltype(__test<_Tp>(0)) type;
2696 template<typename _Tp>
2697 struct __is_nothrow_swappable_impl
2698 : public __swappable_details::__do_is_nothrow_swappable_impl
2700 typedef decltype(__test<_Tp>(0)) type;
2703 template<typename _Tp>
2704 struct __is_swappable
2705 : public __is_swappable_impl<_Tp>::type
2708 template<
typename _Tp>
2709 struct __is_nothrow_swappable
2710 :
public __is_nothrow_swappable_impl<_Tp>::type
2713 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
2714 #define __cpp_lib_is_swappable 201603
2718 template<
typename _Tp>
2720 :
public __is_swappable_impl<_Tp>::type
2722 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2723 "template argument must be a complete class or an unbounded array");
2727 template<
typename _Tp>
2729 :
public __is_nothrow_swappable_impl<_Tp>::type
2731 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2732 "template argument must be a complete class or an unbounded array");
2735 #if __cplusplus >= 201402L
2737 template<
typename _Tp>
2742 template<
typename _Tp>
2745 #endif // __cplusplus >= 201402L
2747 namespace __swappable_with_details {
2750 struct __do_is_swappable_with_impl
2752 template<
typename _Tp,
typename _Up,
typename
2753 = decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
2755 = decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
2758 template<
typename,
typename>
2762 struct __do_is_nothrow_swappable_with_impl
2764 template<
typename _Tp,
typename _Up>
2766 noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
2768 noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
2771 template<
typename,
typename>
2777 template<
typename _Tp,
typename _Up>
2778 struct __is_swappable_with_impl
2779 :
public __swappable_with_details::__do_is_swappable_with_impl
2781 typedef decltype(__test<_Tp, _Up>(0)) type;
2785 template<typename _Tp>
2786 struct __is_swappable_with_impl<_Tp&, _Tp&>
2787 : public __swappable_details::__do_is_swappable_impl
2789 typedef decltype(__test<_Tp&>(0)) type;
2792 template<typename _Tp, typename _Up>
2793 struct __is_nothrow_swappable_with_impl
2794 : public __swappable_with_details::__do_is_nothrow_swappable_with_impl
2796 typedef decltype(__test<_Tp, _Up>(0)) type;
2800 template<typename _Tp>
2801 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
2802 : public __swappable_details::__do_is_nothrow_swappable_impl
2804 typedef decltype(__test<_Tp&>(0)) type;
2808 template<typename _Tp, typename _Up>
2810 : public __is_swappable_with_impl<_Tp, _Up>::type
2814 template<
typename _Tp,
typename _Up>
2816 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
2819 #if __cplusplus >= 201402L
2821 template<
typename _Tp,
typename _Up>
2826 template<
typename _Tp,
typename _Up>
2829 #endif // __cplusplus >= 201402L
2831 #endif// c++1z or gnu++11
2836 template<
typename _Result,
typename _Ret,
2841 template<
typename _Result,
typename _Ret>
2842 struct __is_invocable_impl<_Result, _Ret,
2844 __void_t<typename _Result::type>>
2848 #pragma GCC diagnostic push
2849 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2851 template<
typename _Result,
typename _Ret>
2852 struct __is_invocable_impl<_Result, _Ret,
2854 __void_t<typename _Result::type>>
2859 static typename _Result::type _S_get();
2861 template<
typename _Tp>
2862 static void _S_conv(_Tp);
2865 template<typename _Tp, typename = decltype(_S_conv<_Tp>(_S_get()))>
2869 template<
typename _Tp>
2874 using type = decltype(_S_test<_Ret>(1));
2876 #pragma GCC diagnostic pop
2878 template<
typename _Fn,
typename... _ArgTypes>
2879 struct __is_invocable
2880 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2883 template<
typename _Fn,
typename _Tp,
typename... _Args>
2884 constexpr
bool __call_is_nt(__invoke_memfun_ref)
2886 using _Up =
typename __inv_unwrap<_Tp>::type;
2887 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
2888 std::declval<_Args>()...));
2891 template<
typename _Fn,
typename _Tp,
typename... _Args>
2892 constexpr
bool __call_is_nt(__invoke_memfun_deref)
2894 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
2895 std::declval<_Args>()...));
2898 template<
typename _Fn,
typename _Tp>
2899 constexpr
bool __call_is_nt(__invoke_memobj_ref)
2901 using _Up =
typename __inv_unwrap<_Tp>::type;
2902 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
2905 template<
typename _Fn,
typename _Tp>
2906 constexpr
bool __call_is_nt(__invoke_memobj_deref)
2908 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
2911 template<
typename _Fn,
typename... _Args>
2912 constexpr
bool __call_is_nt(__invoke_other)
2914 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
2917 template<
typename _Result,
typename _Fn,
typename... _Args>
2918 struct __call_is_nothrow
2920 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
2924 template<
typename _Fn,
typename... _Args>
2925 using __call_is_nothrow_
2926 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
2929 template<
typename _Fn,
typename... _Args>
2930 struct __is_nothrow_invocable
2931 : __and_<__is_invocable<_Fn, _Args...>,
2932 __call_is_nothrow_<_Fn, _Args...>>::type
2935 #pragma GCC diagnostic push
2936 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2937 struct __nonesuchbase {};
2938 struct __nonesuch :
private __nonesuchbase {
2939 ~__nonesuch() =
delete;
2940 __nonesuch(__nonesuch
const&) =
delete;
2941 void operator=(__nonesuch
const&) =
delete;
2943 #pragma GCC diagnostic pop
2945 #if __cplusplus >= 201703L
2946 # define __cpp_lib_is_invocable 201703
2949 template<
typename _Functor,
typename... _ArgTypes>
2950 struct invoke_result
2951 :
public __invoke_result<_Functor, _ArgTypes...>
2955 template<
typename _Fn,
typename... _Args>
2956 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
2959 template<
typename _Fn,
typename... _ArgTypes>
2961 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2963 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2964 "_Fn must be a complete class or an unbounded array");
2968 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2969 struct is_invocable_r
2970 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
2972 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2973 "_Fn must be a complete class or an unbounded array");
2977 template<
typename _Fn,
typename... _ArgTypes>
2978 struct is_nothrow_invocable
2979 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
2980 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2982 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2983 "_Fn must be a complete class or an unbounded array");
2986 template<
typename _Result,
typename _Ret,
typename =
void>
2987 struct __is_nt_invocable_impl :
false_type { };
2989 template<
typename _Result,
typename _Ret>
2990 struct __is_nt_invocable_impl<_Result, _Ret,
2991 __void_t<typename _Result::type>>
2992 : __or_<is_void<_Ret>,
2993 __is_nothrow_convertible<typename _Result::type, _Ret>>
2997 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2998 struct is_nothrow_invocable_r
2999 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
3000 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3004 template<
typename _Fn,
typename... _Args>
3005 inline constexpr
bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
3008 template<
typename _Fn,
typename... _Args>
3009 inline constexpr
bool is_nothrow_invocable_v
3010 = is_nothrow_invocable<_Fn, _Args...>::value;
3013 template<
typename _Ret,
typename _Fn,
typename... _Args>
3014 inline constexpr
bool is_invocable_r_v
3015 = is_invocable_r<_Ret, _Fn, _Args...>::value;
3018 template<
typename _Ret,
typename _Fn,
typename... _Args>
3019 inline constexpr
bool is_nothrow_invocable_r_v
3020 = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3023 #if __cplusplus >= 201703L
3024 # define __cpp_lib_type_trait_variable_templates 201510L
3025 template <
typename _Tp>
3026 inline constexpr
bool is_void_v = is_void<_Tp>::value;
3027 template <
typename _Tp>
3028 inline constexpr
bool is_null_pointer_v = is_null_pointer<_Tp>::value;
3029 template <
typename _Tp>
3030 inline constexpr
bool is_integral_v = is_integral<_Tp>::value;
3031 template <
typename _Tp>
3032 inline constexpr
bool is_floating_point_v = is_floating_point<_Tp>::value;
3033 template <
typename _Tp>
3034 inline constexpr
bool is_array_v = is_array<_Tp>::value;
3035 template <
typename _Tp>
3036 inline constexpr
bool is_pointer_v = is_pointer<_Tp>::value;
3037 template <
typename _Tp>
3038 inline constexpr
bool is_lvalue_reference_v =
3039 is_lvalue_reference<_Tp>::value;
3040 template <
typename _Tp>
3041 inline constexpr
bool is_rvalue_reference_v =
3042 is_rvalue_reference<_Tp>::value;
3043 template <
typename _Tp>
3044 inline constexpr
bool is_member_object_pointer_v =
3045 is_member_object_pointer<_Tp>::value;
3046 template <
typename _Tp>
3047 inline constexpr
bool is_member_function_pointer_v =
3048 is_member_function_pointer<_Tp>::value;
3049 template <
typename _Tp>
3050 inline constexpr
bool is_enum_v = is_enum<_Tp>::value;
3051 template <
typename _Tp>
3052 inline constexpr
bool is_union_v = is_union<_Tp>::value;
3053 template <
typename _Tp>
3054 inline constexpr
bool is_class_v = is_class<_Tp>::value;
3055 template <
typename _Tp>
3056 inline constexpr
bool is_function_v = is_function<_Tp>::value;
3057 template <
typename _Tp>
3058 inline constexpr
bool is_reference_v = is_reference<_Tp>::value;
3059 template <
typename _Tp>
3060 inline constexpr
bool is_arithmetic_v = is_arithmetic<_Tp>::value;
3061 template <
typename _Tp>
3062 inline constexpr
bool is_fundamental_v = is_fundamental<_Tp>::value;
3063 template <
typename _Tp>
3064 inline constexpr
bool is_object_v = is_object<_Tp>::value;
3065 template <
typename _Tp>
3066 inline constexpr
bool is_scalar_v = is_scalar<_Tp>::value;
3067 template <
typename _Tp>
3068 inline constexpr
bool is_compound_v = is_compound<_Tp>::value;
3069 template <
typename _Tp>
3070 inline constexpr
bool is_member_pointer_v = is_member_pointer<_Tp>::value;
3071 template <
typename _Tp>
3072 inline constexpr
bool is_const_v = is_const<_Tp>::value;
3073 template <
typename _Tp>
3074 inline constexpr
bool is_volatile_v = is_volatile<_Tp>::value;
3075 template <
typename _Tp>
3076 inline constexpr
bool is_trivial_v = is_trivial<_Tp>::value;
3077 template <
typename _Tp>
3078 inline constexpr
bool is_trivially_copyable_v =
3079 is_trivially_copyable<_Tp>::value;
3080 template <
typename _Tp>
3081 inline constexpr
bool is_standard_layout_v = is_standard_layout<_Tp>::value;
3082 #pragma GCC diagnostic push
3083 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
3084 template <
typename _Tp>
3085 _GLIBCXX20_DEPRECATED(
"use is_standard_layout_v && is_trivial_v instead")
3086 inline constexpr
bool is_pod_v = is_pod<_Tp>::value;
3087 #pragma GCC diagnostic pop
3088 template <
typename _Tp>
3089 inline constexpr
bool is_literal_type_v = is_literal_type<_Tp>::value;
3090 template <
typename _Tp>
3091 inline constexpr
bool is_empty_v = is_empty<_Tp>::value;
3092 template <
typename _Tp>
3093 inline constexpr
bool is_polymorphic_v = is_polymorphic<_Tp>::value;
3094 template <
typename _Tp>
3095 inline constexpr
bool is_abstract_v = is_abstract<_Tp>::value;
3096 template <
typename _Tp>
3097 inline constexpr
bool is_final_v = is_final<_Tp>::value;
3098 template <
typename _Tp>
3099 inline constexpr
bool is_signed_v = is_signed<_Tp>::value;
3100 template <
typename _Tp>
3101 inline constexpr
bool is_unsigned_v = is_unsigned<_Tp>::value;
3102 template <
typename _Tp,
typename... _Args>
3103 inline constexpr
bool is_constructible_v =
3104 is_constructible<_Tp, _Args...>::value;
3105 template <
typename _Tp>
3106 inline constexpr
bool is_default_constructible_v =
3107 is_default_constructible<_Tp>::value;
3108 template <
typename _Tp>
3109 inline constexpr
bool is_copy_constructible_v =
3110 is_copy_constructible<_Tp>::value;
3111 template <
typename _Tp>
3112 inline constexpr
bool is_move_constructible_v =
3113 is_move_constructible<_Tp>::value;
3114 template <
typename _Tp,
typename _Up>
3115 inline constexpr
bool is_assignable_v = is_assignable<_Tp, _Up>::value;
3116 template <
typename _Tp>
3117 inline constexpr
bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
3118 template <
typename _Tp>
3119 inline constexpr
bool is_move_assignable_v = is_move_assignable<_Tp>::value;
3120 template <
typename _Tp>
3121 inline constexpr
bool is_destructible_v = is_destructible<_Tp>::value;
3122 template <
typename _Tp,
typename... _Args>
3123 inline constexpr
bool is_trivially_constructible_v =
3124 is_trivially_constructible<_Tp, _Args...>::value;
3125 template <
typename _Tp>
3126 inline constexpr
bool is_trivially_default_constructible_v =
3127 is_trivially_default_constructible<_Tp>::value;
3128 template <
typename _Tp>
3129 inline constexpr
bool is_trivially_copy_constructible_v =
3130 is_trivially_copy_constructible<_Tp>::value;
3131 template <
typename _Tp>
3132 inline constexpr
bool is_trivially_move_constructible_v =
3133 is_trivially_move_constructible<_Tp>::value;
3134 template <
typename _Tp,
typename _Up>
3135 inline constexpr
bool is_trivially_assignable_v =
3136 is_trivially_assignable<_Tp, _Up>::value;
3137 template <
typename _Tp>
3138 inline constexpr
bool is_trivially_copy_assignable_v =
3139 is_trivially_copy_assignable<_Tp>::value;
3140 template <
typename _Tp>
3141 inline constexpr
bool is_trivially_move_assignable_v =
3142 is_trivially_move_assignable<_Tp>::value;
3143 template <
typename _Tp>
3144 inline constexpr
bool is_trivially_destructible_v =
3145 is_trivially_destructible<_Tp>::value;
3146 template <
typename _Tp,
typename... _Args>
3147 inline constexpr
bool is_nothrow_constructible_v =
3148 is_nothrow_constructible<_Tp, _Args...>::value;
3149 template <
typename _Tp>
3150 inline constexpr
bool is_nothrow_default_constructible_v =
3151 is_nothrow_default_constructible<_Tp>::value;
3152 template <
typename _Tp>
3153 inline constexpr
bool is_nothrow_copy_constructible_v =
3154 is_nothrow_copy_constructible<_Tp>::value;
3155 template <
typename _Tp>
3156 inline constexpr
bool is_nothrow_move_constructible_v =
3157 is_nothrow_move_constructible<_Tp>::value;
3158 template <
typename _Tp,
typename _Up>
3159 inline constexpr
bool is_nothrow_assignable_v =
3160 is_nothrow_assignable<_Tp, _Up>::value;
3161 template <
typename _Tp>
3162 inline constexpr
bool is_nothrow_copy_assignable_v =
3163 is_nothrow_copy_assignable<_Tp>::value;
3164 template <
typename _Tp>
3165 inline constexpr
bool is_nothrow_move_assignable_v =
3166 is_nothrow_move_assignable<_Tp>::value;
3167 template <
typename _Tp>
3168 inline constexpr
bool is_nothrow_destructible_v =
3169 is_nothrow_destructible<_Tp>::value;
3170 template <
typename _Tp>
3171 inline constexpr
bool has_virtual_destructor_v =
3172 has_virtual_destructor<_Tp>::value;
3173 template <
typename _Tp>
3174 inline constexpr
size_t alignment_of_v = alignment_of<_Tp>::value;
3175 template <
typename _Tp>
3176 inline constexpr
size_t rank_v = rank<_Tp>::value;
3177 template <
typename _Tp,
unsigned _Idx = 0>
3178 inline constexpr
size_t extent_v = extent<_Tp, _Idx>::value;
3179 #ifdef _GLIBCXX_BUILTIN_IS_SAME_AS
3180 template <
typename _Tp,
typename _Up>
3181 inline constexpr
bool is_same_v = _GLIBCXX_BUILTIN_IS_SAME_AS(_Tp, _Up);
3183 template <
typename _Tp,
typename _Up>
3186 template <
typename _Base,
typename _Derived>
3187 inline constexpr
bool is_base_of_v = is_base_of<_Base, _Derived>::value;
3188 template <
typename _From,
typename _To>
3189 inline constexpr
bool is_convertible_v = is_convertible<_From, _To>::value;
3191 #ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
3192 # define __cpp_lib_has_unique_object_representations 201606
3194 template<
typename _Tp>
3195 struct has_unique_object_representations
3196 : bool_constant<__has_unique_object_representations(
3197 remove_cv_t<remove_all_extents_t<_Tp>>
3200 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3201 "template argument must be a complete class or an unbounded array");
3204 template<
typename _Tp>
3205 inline constexpr
bool has_unique_object_representations_v
3206 = has_unique_object_representations<_Tp>::value;
3209 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
3210 # define __cpp_lib_is_aggregate 201703
3212 template<
typename _Tp>
3214 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3218 template<
typename _Tp>
3219 inline constexpr
bool is_aggregate_v = is_aggregate<_Tp>::value;
3223 #if __cplusplus > 201703L
3225 template<
typename _Tp>
3228 using type = __remove_cvref_t<_Tp>;
3231 template<
typename _Tp>
3232 using remove_cvref_t = __remove_cvref_t<_Tp>;
3235 template<
typename _Tp>
3236 struct type_identity {
using type = _Tp; };
3238 template<
typename _Tp>
3239 using type_identity_t =
typename type_identity<_Tp>::type;
3242 template<
typename _Tp>
3243 struct unwrap_reference {
using type = _Tp; };
3245 template<
typename _Tp>
3246 struct unwrap_reference<reference_wrapper<_Tp>> {
using type = _Tp&; };
3248 template<
typename _Tp>
3249 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3252 template<
typename _Tp>
3253 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
3255 template<
typename _Tp>
3256 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3258 #define __cpp_lib_bounded_array_traits 201902L
3261 template<
typename _Tp>
3262 struct is_bounded_array
3263 :
public __is_array_known_bounds<_Tp>
3267 template<
typename _Tp>
3268 struct is_unbounded_array
3269 :
public __is_array_unknown_bounds<_Tp>
3272 template<
typename _Tp>
3273 inline constexpr
bool is_bounded_array_v
3274 = is_bounded_array<_Tp>::value;
3276 template<
typename _Tp>
3277 inline constexpr
bool is_unbounded_array_v
3278 = is_unbounded_array<_Tp>::value;
3280 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
3282 #define __cpp_lib_is_constant_evaluated 201811L
3284 constexpr
inline bool
3285 is_constant_evaluated() noexcept
3286 {
return __builtin_is_constant_evaluated(); }
3289 template<
typename _From,
typename _To>
3290 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
3292 template<
typename _Xp,
typename _Yp>
3294 = decltype(
false ? declval<_Xp(&)()>()() : declval<_Yp(&)()>()());
3296 template<
typename _Ap,
typename _Bp,
typename =
void>
3297 struct __common_ref_impl
3301 template<
typename _Ap,
typename _Bp>
3302 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
3305 template<
typename _Xp,
typename _Yp>
3306 struct __common_ref_impl<_Xp&, _Yp&,
3307 __void_t<__cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>>>
3308 {
using type = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>; };
3311 template<
typename _Xp,
typename _Yp>
3312 using __common_ref_C = remove_reference_t<__common_ref<_Xp&, _Yp&>>&&;
3315 template<
typename _Xp,
typename _Yp>
3316 struct __common_ref_impl<_Xp&&, _Yp&&,
3317 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
3318 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
3319 {
using type = __common_ref_C<_Xp, _Yp>; };
3322 template<
typename _Xp,
typename _Yp>
3323 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
3326 template<
typename _Xp,
typename _Yp>
3327 struct __common_ref_impl<_Xp&&, _Yp&,
3328 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
3329 {
using type = __common_ref_D<_Xp, _Yp>; };
3332 template<
typename _Xp,
typename _Yp>
3333 struct __common_ref_impl<_Xp&, _Yp&&>
3334 : __common_ref_impl<_Yp&&, _Xp&>
3337 template<
typename _Tp,
typename _Up,
3338 template<
typename>
class _TQual,
template<
typename>
class _UQual>
3339 struct basic_common_reference
3342 template<
typename _Tp>
3344 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
3346 template<
typename _Tp>
3348 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
3350 template<
typename _Tp>
3351 struct __xref<_Tp&&>
3352 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
3354 template<
typename _Tp1,
typename _Tp2>
3355 using __basic_common_ref
3356 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
3357 remove_cvref_t<_Tp2>,
3358 __xref<_Tp1>::template __type,
3359 __xref<_Tp2>::template __type>::type;
3361 template<
typename... _Tp>
3362 struct common_reference;
3364 template<
typename... _Tp>
3365 using common_reference_t =
typename common_reference<_Tp...>::type;
3369 struct common_reference<>
3373 template<
typename _Tp0>
3374 struct common_reference<_Tp0>
3375 {
using type = _Tp0; };
3377 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1,
typename =
void>
3378 struct __common_reference_impl
3379 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
3383 template<
typename _Tp1,
typename _Tp2>
3384 struct common_reference<_Tp1, _Tp2>
3385 : __common_reference_impl<_Tp1, _Tp2>
3389 template<
typename _Tp1,
typename _Tp2>
3390 struct __common_reference_impl<_Tp1&, _Tp2&, 1,
3391 void_t<__common_ref<_Tp1&, _Tp2&>>>
3392 {
using type = __common_ref<_Tp1&, _Tp2&>; };
3394 template<
typename _Tp1,
typename _Tp2>
3395 struct __common_reference_impl<_Tp1&&, _Tp2&&, 1,
3396 void_t<__common_ref<_Tp1&&, _Tp2&&>>>
3397 {
using type = __common_ref<_Tp1&&, _Tp2&&>; };
3399 template<
typename _Tp1,
typename _Tp2>
3400 struct __common_reference_impl<_Tp1&, _Tp2&&, 1,
3401 void_t<__common_ref<_Tp1&, _Tp2&&>>>
3402 {
using type = __common_ref<_Tp1&, _Tp2&&>; };
3404 template<
typename _Tp1,
typename _Tp2>
3405 struct __common_reference_impl<_Tp1&&, _Tp2&, 1,
3406 void_t<__common_ref<_Tp1&&, _Tp2&>>>
3407 {
using type = __common_ref<_Tp1&&, _Tp2&>; };
3410 template<
typename _Tp1,
typename _Tp2>
3411 struct __common_reference_impl<_Tp1, _Tp2, 2,
3412 void_t<__basic_common_ref<_Tp1, _Tp2>>>
3413 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
3416 template<
typename _Tp1,
typename _Tp2>
3417 struct __common_reference_impl<_Tp1, _Tp2, 3,
3418 void_t<__cond_res<_Tp1, _Tp2>>>
3419 {
using type = __cond_res<_Tp1, _Tp2>; };
3422 template<
typename _Tp1,
typename _Tp2>
3423 struct __common_reference_impl<_Tp1, _Tp2, 4,
3425 {
using type = common_type_t<_Tp1, _Tp2>; };
3428 template<
typename _Tp1,
typename _Tp2>
3429 struct __common_reference_impl<_Tp1, _Tp2, 5, void>
3433 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3434 struct common_reference<_Tp1, _Tp2, _Rest...>
3435 : __common_type_fold<common_reference<_Tp1, _Tp2>,
3436 __common_type_pack<_Rest...>>
3440 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3441 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
3442 __common_type_pack<_Rest...>,
3443 void_t<common_reference_t<_Tp1, _Tp2>>>
3444 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
3449 _GLIBCXX_END_NAMESPACE_VERSION
3454 #endif // _GLIBCXX_TYPE_TRAITS