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>
694 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
695 "template argument must be a complete class or an unbounded array");
699 template<
typename _Tp>
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>
714 template<
typename _Tp>
719 #if __cplusplus >= 201402L
720 #define __cpp_lib_is_final 201402L
722 template<
typename _Tp>
729 template<
typename _Tp>
734 template<
typename _Tp,
736 struct __is_signed_helper
739 template<
typename _Tp>
740 struct __is_signed_helper<_Tp, true>
741 :
public integral_constant<bool, _Tp(-1) < _Tp(0)>
745 template<typename _Tp>
747 : public __is_signed_helper<_Tp>::type
751 template<typename _Tp>
753 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>
764 template<typename _Tp, typename _Up = _Tp&&>
768 template<typename _Tp>
772 template<typename _Tp>
773 auto declval() noexcept -> decltype(__declval<_Tp>(0));
775 template<typename, unsigned = 0>
781 template<typename _Tp>
782 struct __is_array_known_bounds
786 template<
typename _Tp>
787 struct __is_array_unknown_bounds
788 :
public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
796 struct __do_is_destructible_impl
798 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
805 template<
typename _Tp>
806 struct __is_destructible_impl
807 :
public __do_is_destructible_impl
809 typedef decltype(__test<_Tp>(0)) type;
812 template<typename _Tp,
813 bool = __or_<is_void<_Tp>,
814 __is_array_unknown_bounds<_Tp>,
815 is_function<_Tp>>::value,
816 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
817 struct __is_destructible_safe;
819 template<typename _Tp>
820 struct __is_destructible_safe<_Tp, false, false>
821 : public __is_destructible_impl<typename
822 remove_all_extents<_Tp>::type>::type
825 template<
typename _Tp>
826 struct __is_destructible_safe<_Tp, true, false>
829 template<
typename _Tp>
830 struct __is_destructible_safe<_Tp, false, true>
834 template<
typename _Tp>
836 :
public __is_destructible_safe<_Tp>::type
838 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
839 "template argument must be a complete class or an unbounded array");
846 struct __do_is_nt_destructible_impl
848 template<
typename _Tp>
856 template<
typename _Tp>
857 struct __is_nt_destructible_impl
858 :
public __do_is_nt_destructible_impl
860 typedef decltype(__test<_Tp>(0)) type;
863 template<typename _Tp,
864 bool = __or_<is_void<_Tp>,
865 __is_array_unknown_bounds<_Tp>,
866 is_function<_Tp>>::value,
867 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
868 struct __is_nt_destructible_safe;
870 template<typename _Tp>
871 struct __is_nt_destructible_safe<_Tp, false, false>
872 : public __is_nt_destructible_impl<typename
873 remove_all_extents<_Tp>::type>::type
876 template<
typename _Tp>
877 struct __is_nt_destructible_safe<_Tp, true, false>
880 template<
typename _Tp>
881 struct __is_nt_destructible_safe<_Tp, false, true>
885 template<
typename _Tp>
887 :
public __is_nt_destructible_safe<_Tp>::type
889 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
890 "template argument must be a complete class or an unbounded array");
893 template<
typename _Tp,
typename... _Args>
894 struct __is_constructible_impl
899 template<
typename _Tp,
typename... _Args>
901 :
public __is_constructible_impl<_Tp, _Args...>
903 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
904 "template argument must be a complete class or an unbounded array");
908 template<
typename _Tp>
910 :
public __is_constructible_impl<_Tp>::type
912 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
913 "template argument must be a complete class or an unbounded array");
916 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
917 struct __is_copy_constructible_impl;
919 template<
typename _Tp>
920 struct __is_copy_constructible_impl<_Tp, false>
923 template<
typename _Tp>
924 struct __is_copy_constructible_impl<_Tp, true>
925 :
public __is_constructible_impl<_Tp, const _Tp&>
929 template<
typename _Tp>
931 :
public __is_copy_constructible_impl<_Tp>
933 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
934 "template argument must be a complete class or an unbounded array");
937 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
938 struct __is_move_constructible_impl;
940 template<
typename _Tp>
941 struct __is_move_constructible_impl<_Tp, false>
944 template<
typename _Tp>
945 struct __is_move_constructible_impl<_Tp, true>
946 :
public __is_constructible_impl<_Tp, _Tp&&>
950 template<
typename _Tp>
952 :
public __is_move_constructible_impl<_Tp>
954 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
955 "template argument must be a complete class or an unbounded array");
958 template<
typename _Tp>
959 struct __is_nt_default_constructible_atom
963 template<typename _Tp, bool = is_array<_Tp>::value>
964 struct __is_nt_default_constructible_impl;
966 template<
typename _Tp>
967 struct __is_nt_default_constructible_impl<_Tp, true>
968 :
public __and_<__is_array_known_bounds<_Tp>,
969 __is_nt_default_constructible_atom<typename
970 remove_all_extents<_Tp>::type>>
973 template<
typename _Tp>
974 struct __is_nt_default_constructible_impl<_Tp, false>
975 :
public __is_nt_default_constructible_atom<_Tp>
978 template<
typename _Tp>
979 using __is_nothrow_default_constructible_impl
980 = __and_<__is_constructible_impl<_Tp>,
981 __is_nt_default_constructible_impl<_Tp>>;
984 template<
typename _Tp>
986 :
public __is_nothrow_default_constructible_impl<_Tp>::type
988 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
989 "template argument must be a complete class or an unbounded array");
992 template<
typename _Tp,
typename... _Args>
993 struct __is_nt_constructible_impl
997 template<
typename _Tp,
typename _Arg>
998 struct __is_nt_constructible_impl<_Tp, _Arg>
999 :
public integral_constant<bool,
1000 noexcept(static_cast<_Tp>(declval<_Arg>()))>
1003 template<
typename _Tp>
1004 struct __is_nt_constructible_impl<_Tp>
1005 :
public __is_nothrow_default_constructible_impl<_Tp>
1008 template<
typename _Tp,
typename... _Args>
1009 struct __is_nothrow_constructible_impl
1010 :
public __and_<__is_constructible_impl<_Tp, _Args...>,
1011 __is_nt_constructible_impl<_Tp, _Args...>>
1015 template<
typename _Tp,
typename... _Args>
1017 :
public __is_nothrow_constructible_impl<_Tp, _Args...>::type
1019 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1020 "template argument must be a complete class or an unbounded array");
1023 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1024 struct __is_nothrow_copy_constructible_impl;
1026 template<
typename _Tp>
1027 struct __is_nothrow_copy_constructible_impl<_Tp, false>
1030 template<
typename _Tp>
1031 struct __is_nothrow_copy_constructible_impl<_Tp, true>
1032 :
public __is_nothrow_constructible_impl<_Tp, const _Tp&>
1036 template<
typename _Tp>
1038 :
public __is_nothrow_copy_constructible_impl<_Tp>::type
1040 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1041 "template argument must be a complete class or an unbounded array");
1044 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1045 struct __is_nothrow_move_constructible_impl;
1047 template<
typename _Tp>
1048 struct __is_nothrow_move_constructible_impl<_Tp, false>
1051 template<
typename _Tp>
1052 struct __is_nothrow_move_constructible_impl<_Tp, true>
1053 :
public __is_nothrow_constructible_impl<_Tp, _Tp&&>
1057 template<
typename _Tp>
1059 :
public __is_nothrow_move_constructible_impl<_Tp>::type
1061 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1062 "template argument must be a complete class or an unbounded array");
1066 template<
typename _Tp,
typename _Up>
1070 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1071 "template argument must be a complete class or an unbounded array");
1074 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1075 struct __is_copy_assignable_impl;
1077 template<
typename _Tp>
1078 struct __is_copy_assignable_impl<_Tp, false>
1081 template<
typename _Tp>
1082 struct __is_copy_assignable_impl<_Tp, true>
1083 :
public __bool_constant<__is_assignable(_Tp&, const _Tp&)>
1087 template<
typename _Tp>
1089 :
public __is_copy_assignable_impl<_Tp>::type
1091 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1092 "template argument must be a complete class or an unbounded array");
1095 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1096 struct __is_move_assignable_impl;
1098 template<
typename _Tp>
1099 struct __is_move_assignable_impl<_Tp, false>
1102 template<
typename _Tp>
1103 struct __is_move_assignable_impl<_Tp, true>
1104 :
public __bool_constant<__is_assignable(_Tp&, _Tp&&)>
1108 template<
typename _Tp>
1110 :
public __is_move_assignable_impl<_Tp>::type
1112 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1113 "template argument must be a complete class or an unbounded array");
1116 template<
typename _Tp,
typename _Up>
1117 struct __is_nt_assignable_impl
1121 template<
typename _Tp,
typename _Up>
1122 struct __is_nothrow_assignable_impl
1123 :
public __and_<__bool_constant<__is_assignable(_Tp, _Up)>,
1124 __is_nt_assignable_impl<_Tp, _Up>>
1128 template<
typename _Tp,
typename _Up>
1130 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1132 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1133 "template argument must be a complete class or an unbounded array");
1136 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1137 struct __is_nt_copy_assignable_impl;
1139 template<
typename _Tp>
1140 struct __is_nt_copy_assignable_impl<_Tp, false>
1143 template<
typename _Tp>
1144 struct __is_nt_copy_assignable_impl<_Tp, true>
1145 :
public __is_nothrow_assignable_impl<_Tp&, const _Tp&>
1149 template<
typename _Tp>
1151 :
public __is_nt_copy_assignable_impl<_Tp>
1153 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1154 "template argument must be a complete class or an unbounded array");
1157 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1158 struct __is_nt_move_assignable_impl;
1160 template<
typename _Tp>
1161 struct __is_nt_move_assignable_impl<_Tp, false>
1164 template<
typename _Tp>
1165 struct __is_nt_move_assignable_impl<_Tp, true>
1166 :
public __is_nothrow_assignable_impl<_Tp&, _Tp&&>
1170 template<
typename _Tp>
1172 :
public __is_nt_move_assignable_impl<_Tp>
1174 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1175 "template argument must be a complete class or an unbounded array");
1179 template<
typename _Tp,
typename... _Args>
1183 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1184 "template argument must be a complete class or an unbounded array");
1188 template<
typename _Tp>
1192 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1193 "template argument must be a complete class or an unbounded array");
1196 struct __do_is_implicitly_default_constructible_impl
1198 template <
typename _Tp>
1199 static void __helper(
const _Tp&);
1201 template <
typename _Tp>
1203 decltype(__helper<const _Tp&>({}))* = 0);
1208 template<
typename _Tp>
1209 struct __is_implicitly_default_constructible_impl
1210 :
public __do_is_implicitly_default_constructible_impl
1212 typedef decltype(__test(declval<_Tp>())) type;
1215 template<typename _Tp>
1216 struct __is_implicitly_default_constructible_safe
1217 : public __is_implicitly_default_constructible_impl<_Tp>::type
1220 template <
typename _Tp>
1221 struct __is_implicitly_default_constructible
1222 :
public __and_<__is_constructible_impl<_Tp>,
1223 __is_implicitly_default_constructible_safe<_Tp>>
1226 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1227 struct __is_trivially_copy_constructible_impl;
1229 template<
typename _Tp>
1230 struct __is_trivially_copy_constructible_impl<_Tp, false>
1233 template<
typename _Tp>
1234 struct __is_trivially_copy_constructible_impl<_Tp, true>
1235 :
public __and_<__is_copy_constructible_impl<_Tp>,
1236 integral_constant<bool,
1237 __is_trivially_constructible(_Tp, const _Tp&)>>
1241 template<
typename _Tp>
1243 :
public __is_trivially_copy_constructible_impl<_Tp>
1245 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1246 "template argument must be a complete class or an unbounded array");
1249 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1250 struct __is_trivially_move_constructible_impl;
1252 template<
typename _Tp>
1253 struct __is_trivially_move_constructible_impl<_Tp, false>
1256 template<
typename _Tp>
1257 struct __is_trivially_move_constructible_impl<_Tp, true>
1258 :
public __and_<__is_move_constructible_impl<_Tp>,
1259 integral_constant<bool,
1260 __is_trivially_constructible(_Tp, _Tp&&)>>
1264 template<
typename _Tp>
1266 :
public __is_trivially_move_constructible_impl<_Tp>
1268 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1269 "template argument must be a complete class or an unbounded array");
1273 template<
typename _Tp,
typename _Up>
1277 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1278 "template argument must be a complete class or an unbounded array");
1281 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1282 struct __is_trivially_copy_assignable_impl;
1284 template<
typename _Tp>
1285 struct __is_trivially_copy_assignable_impl<_Tp, false>
1288 template<
typename _Tp>
1289 struct __is_trivially_copy_assignable_impl<_Tp, true>
1290 :
public __bool_constant<__is_trivially_assignable(_Tp&, const _Tp&)>
1294 template<
typename _Tp>
1296 :
public __is_trivially_copy_assignable_impl<_Tp>
1298 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1299 "template argument must be a complete class or an unbounded array");
1302 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1303 struct __is_trivially_move_assignable_impl;
1305 template<
typename _Tp>
1306 struct __is_trivially_move_assignable_impl<_Tp, false>
1309 template<
typename _Tp>
1310 struct __is_trivially_move_assignable_impl<_Tp, true>
1311 :
public __bool_constant<__is_trivially_assignable(_Tp&, _Tp&&)>
1315 template<
typename _Tp>
1317 :
public __is_trivially_move_assignable_impl<_Tp>
1319 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1320 "template argument must be a complete class or an unbounded array");
1324 template<
typename _Tp>
1326 :
public __and_<__is_destructible_safe<_Tp>,
1327 __bool_constant<__has_trivial_destructor(_Tp)>>
1329 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1330 "template argument must be a complete class or an unbounded array");
1335 template<
typename _Tp>
1339 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1340 "template argument must be a complete class or an unbounded array");
1347 template<
typename _Tp>
1351 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1352 "template argument must be a complete class or an unbounded array");
1360 template<
typename _Tp, std::
size_t _Size>
1361 struct rank<_Tp[_Size]>
1364 template<
typename _Tp>
1366 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1369 template<
typename,
unsigned _U
int>
1371 :
public integral_constant<std::size_t, 0> { };
1373 template<
typename _Tp,
unsigned _U
int, std::
size_t _Size>
1374 struct extent<_Tp[_Size], _Uint>
1375 :
public integral_constant<std::size_t,
1376 _Uint == 0 ? _Size : extent<_Tp,
1380 template<
typename _Tp,
unsigned _U
int>
1381 struct extent<_Tp[], _Uint>
1382 :
public integral_constant<std::size_t,
1383 _Uint == 0 ? 0 : extent<_Tp,
1391 template<
typename _Tp,
typename _Up>
1393 #ifdef _GLIBCXX_BUILTIN_IS_SAME_AS
1394 :
public integral_constant<bool, _GLIBCXX_BUILTIN_IS_SAME_AS(_Tp, _Up)>
1400 #ifndef _GLIBCXX_BUILTIN_IS_SAME_AS
1401 template<
typename _Tp>
1402 struct is_same<_Tp, _Tp>
1408 template<
typename _Base,
typename _Derived>
1413 template<
typename _From,
typename _To,
1416 struct __is_convertible_helper
1421 #pragma GCC diagnostic push
1422 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1423 template<
typename _From,
typename _To>
1424 class __is_convertible_helper<_From, _To, false>
1426 template<
typename _To1>
1427 static void __test_aux(_To1) noexcept;
1429 template<
typename _From1,
typename _To1,
1430 typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
1434 template<
typename,
typename>
1439 typedef decltype(__test<_From, _To>(0)) type;
1441 #pragma GCC diagnostic pop
1444 template<
typename _From,
typename _To>
1446 :
public __is_convertible_helper<_From, _To>::type
1449 template<
typename _From,
typename _To,
1452 struct __is_nt_convertible_helper
1456 #pragma GCC diagnostic push
1457 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1458 template<
typename _From,
typename _To>
1459 class __is_nt_convertible_helper<_From, _To, false>
1461 template<
typename _To1>
1462 static void __test_aux(_To1) noexcept;
1464 template<
typename _From1,
typename _To1>
1466 __bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))>
1469 template<
typename,
typename>
1474 using type = decltype(__test<_From, _To>(0));
1476 #pragma GCC diagnostic pop
1479 template<
typename _ToElementType,
typename _FromElementType>
1480 using __is_array_convertible
1481 = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
1484 template<
typename _From,
typename _To>
1485 struct __is_nothrow_convertible
1486 :
public __is_nt_convertible_helper<_From, _To>::type
1489 #if __cplusplus > 201703L
1491 template<
typename _From,
typename _To>
1492 struct is_nothrow_convertible
1493 :
public __is_nt_convertible_helper<_From, _To>::type
1497 template<
typename _From,
typename _To>
1498 inline constexpr
bool is_nothrow_convertible_v
1499 = is_nothrow_convertible<_From, _To>::value;
1505 template<
typename _Tp>
1507 {
typedef _Tp type; };
1509 template<
typename _Tp>
1511 {
typedef _Tp type; };
1514 template<
typename _Tp>
1516 {
typedef _Tp type; };
1518 template<
typename _Tp>
1520 {
typedef _Tp type; };
1523 template<
typename _Tp>
1525 {
using type = _Tp; };
1527 template<
typename _Tp>
1528 struct remove_cv<const _Tp>
1529 {
using type = _Tp; };
1531 template<
typename _Tp>
1532 struct remove_cv<volatile _Tp>
1533 {
using type = _Tp; };
1535 template<
typename _Tp>
1536 struct remove_cv<const volatile _Tp>
1537 {
using type = _Tp; };
1540 template<
typename _Tp>
1542 {
typedef _Tp
const type; };
1545 template<
typename _Tp>
1547 {
typedef _Tp
volatile type; };
1550 template<
typename _Tp>
1557 #if __cplusplus > 201103L
1559 #define __cpp_lib_transformation_trait_aliases 201304
1562 template<
typename _Tp>
1566 template<
typename _Tp>
1570 template<
typename _Tp>
1574 template<
typename _Tp>
1578 template<
typename _Tp>
1582 template<
typename _Tp>
1589 template<
typename _Tp>
1591 {
typedef _Tp type; };
1593 template<
typename _Tp>
1595 {
typedef _Tp type; };
1597 template<
typename _Tp>
1598 struct remove_reference<_Tp&&>
1599 {
typedef _Tp type; };
1601 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1602 struct __add_lvalue_reference_helper
1603 {
typedef _Tp type; };
1605 template<
typename _Tp>
1606 struct __add_lvalue_reference_helper<_Tp, true>
1607 {
typedef _Tp& type; };
1610 template<
typename _Tp>
1612 :
public __add_lvalue_reference_helper<_Tp>
1615 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1616 struct __add_rvalue_reference_helper
1617 {
typedef _Tp type; };
1619 template<
typename _Tp>
1620 struct __add_rvalue_reference_helper<_Tp, true>
1621 {
typedef _Tp&& type; };
1624 template<
typename _Tp>
1626 :
public __add_rvalue_reference_helper<_Tp>
1629 #if __cplusplus > 201103L
1631 template<
typename _Tp>
1635 template<
typename _Tp>
1639 template<
typename _Tp>
1646 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1647 struct __cv_selector;
1649 template<
typename _Unqualified>
1650 struct __cv_selector<_Unqualified, false, false>
1651 {
typedef _Unqualified __type; };
1653 template<
typename _Unqualified>
1654 struct __cv_selector<_Unqualified, false, true>
1655 {
typedef volatile _Unqualified __type; };
1657 template<
typename _Unqualified>
1658 struct __cv_selector<_Unqualified, true, false>
1659 {
typedef const _Unqualified __type; };
1661 template<
typename _Unqualified>
1662 struct __cv_selector<_Unqualified, true, true>
1663 {
typedef const volatile _Unqualified __type; };
1665 template<
typename _Qualified,
typename _Unqualified,
1666 bool _IsConst = is_const<_Qualified>::value,
1667 bool _IsVol = is_volatile<_Qualified>::value>
1668 class __match_cv_qualifiers
1670 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1673 typedef typename __match::__type __type;
1677 template<
typename _Tp>
1678 struct __make_unsigned
1679 {
typedef _Tp __type; };
1682 struct __make_unsigned<char>
1683 {
typedef unsigned char __type; };
1686 struct __make_unsigned<signed char>
1687 {
typedef unsigned char __type; };
1690 struct __make_unsigned<short>
1691 {
typedef unsigned short __type; };
1694 struct __make_unsigned<int>
1695 {
typedef unsigned int __type; };
1698 struct __make_unsigned<long>
1699 {
typedef unsigned long __type; };
1702 struct __make_unsigned<long long>
1703 {
typedef unsigned long long __type; };
1705 #if defined(__GLIBCXX_TYPE_INT_N_0)
1707 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1708 {
typedef unsigned __GLIBCXX_TYPE_INT_N_0 __type; };
1710 #if defined(__GLIBCXX_TYPE_INT_N_1)
1712 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1713 {
typedef unsigned __GLIBCXX_TYPE_INT_N_1 __type; };
1715 #if defined(__GLIBCXX_TYPE_INT_N_2)
1717 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1718 {
typedef unsigned __GLIBCXX_TYPE_INT_N_2 __type; };
1720 #if defined(__GLIBCXX_TYPE_INT_N_3)
1722 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1723 {
typedef unsigned __GLIBCXX_TYPE_INT_N_3 __type; };
1727 template<
typename _Tp,
1728 bool _IsInt = is_integral<_Tp>::value,
1729 bool _IsEnum = is_enum<_Tp>::value>
1730 class __make_unsigned_selector;
1732 template<
typename _Tp>
1733 class __make_unsigned_selector<_Tp, true, false>
1735 using __unsigned_type
1736 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
1740 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1743 class __make_unsigned_selector_base
1746 template<
typename...>
struct _List { };
1748 template<
typename _Tp,
typename... _Up>
1749 struct _List<_Tp, _Up...> : _List<_Up...>
1750 {
static constexpr
size_t __size =
sizeof(_Tp); };
1752 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
1755 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
1756 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
1757 {
using __type = _Uint; };
1759 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
1760 struct __select<_Sz, _List<_Uint, _UInts...>, false>
1761 : __select<_Sz, _List<_UInts...>>
1766 template<
typename _Tp>
1767 class __make_unsigned_selector<_Tp, false, true>
1768 : __make_unsigned_selector_base
1771 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
1772 unsigned long,
unsigned long long>;
1774 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
1778 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1785 #if defined(_GLIBCXX_USE_WCHAR_T)
1787 struct __make_unsigned<wchar_t>
1790 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
1794 #ifdef _GLIBCXX_USE_CHAR8_T
1796 struct __make_unsigned<char8_t>
1799 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
1804 struct __make_unsigned<char16_t>
1807 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
1811 struct __make_unsigned<char32_t>
1814 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
1821 template<
typename _Tp>
1823 {
typedef typename __make_unsigned_selector<_Tp>::__type type; };
1831 template<
typename _Tp>
1832 struct __make_signed
1833 {
typedef _Tp __type; };
1836 struct __make_signed<char>
1837 {
typedef signed char __type; };
1840 struct __make_signed<unsigned char>
1841 {
typedef signed char __type; };
1844 struct __make_signed<unsigned short>
1845 {
typedef signed short __type; };
1848 struct __make_signed<unsigned int>
1849 {
typedef signed int __type; };
1852 struct __make_signed<unsigned long>
1853 {
typedef signed long __type; };
1856 struct __make_signed<unsigned long long>
1857 {
typedef signed long long __type; };
1859 #if defined(__GLIBCXX_TYPE_INT_N_0)
1861 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
1862 {
typedef __GLIBCXX_TYPE_INT_N_0 __type; };
1864 #if defined(__GLIBCXX_TYPE_INT_N_1)
1866 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
1867 {
typedef __GLIBCXX_TYPE_INT_N_1 __type; };
1869 #if defined(__GLIBCXX_TYPE_INT_N_2)
1871 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
1872 {
typedef __GLIBCXX_TYPE_INT_N_2 __type; };
1874 #if defined(__GLIBCXX_TYPE_INT_N_3)
1876 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
1877 {
typedef __GLIBCXX_TYPE_INT_N_3 __type; };
1881 template<
typename _Tp,
1882 bool _IsInt = is_integral<_Tp>::value,
1883 bool _IsEnum = is_enum<_Tp>::value>
1884 class __make_signed_selector;
1886 template<
typename _Tp>
1887 class __make_signed_selector<_Tp, true, false>
1890 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
1894 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
1898 template<
typename _Tp>
1899 class __make_signed_selector<_Tp, false, true>
1901 typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
1904 typedef typename __make_signed_selector<__unsigned_type>::__type __type;
1911 #if defined(_GLIBCXX_USE_WCHAR_T)
1913 struct __make_signed<wchar_t>
1916 =
typename __make_signed_selector<wchar_t, false, true>::__type;
1920 #if defined(_GLIBCXX_USE_CHAR8_T)
1922 struct __make_signed<char8_t>
1925 =
typename __make_signed_selector<char8_t, false, true>::__type;
1930 struct __make_signed<char16_t>
1933 =
typename __make_signed_selector<char16_t, false, true>::__type;
1937 struct __make_signed<char32_t>
1940 =
typename __make_signed_selector<char32_t, false, true>::__type;
1947 template<
typename _Tp>
1949 {
typedef typename __make_signed_selector<_Tp>::__type type; };
1955 #if __cplusplus > 201103L
1957 template<
typename _Tp>
1961 template<
typename _Tp>
1968 template<
typename _Tp>
1970 {
typedef _Tp type; };
1972 template<
typename _Tp, std::
size_t _Size>
1974 {
typedef _Tp type; };
1976 template<
typename _Tp>
1977 struct remove_extent<_Tp[]>
1978 {
typedef _Tp type; };
1981 template<
typename _Tp>
1982 struct remove_all_extents
1983 {
typedef _Tp type; };
1985 template<
typename _Tp, std::
size_t _Size>
1986 struct remove_all_extents<_Tp[_Size]>
1987 {
typedef typename remove_all_extents<_Tp>::type type; };
1989 template<
typename _Tp>
1990 struct remove_all_extents<_Tp[]>
1991 {
typedef typename remove_all_extents<_Tp>::type type; };
1993 #if __cplusplus > 201103L
1995 template<
typename _Tp>
1999 template<
typename _Tp>
2005 template<
typename _Tp,
typename>
2006 struct __remove_pointer_helper
2007 {
typedef _Tp type; };
2009 template<
typename _Tp,
typename _Up>
2010 struct __remove_pointer_helper<_Tp, _Up*>
2011 {
typedef _Up type; };
2014 template<
typename _Tp>
2016 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2020 template<
typename _Tp,
bool = __or_<__is_referenceable<_Tp>,
2021 is_
void<_Tp>>::value>
2023 {
typedef _Tp type; };
2025 template<
typename _Tp>
2027 {
typedef typename remove_reference<_Tp>::type* type; };
2029 template<
typename _Tp>
2031 :
public __add_pointer_helper<_Tp>
2034 #if __cplusplus > 201103L
2036 template<
typename _Tp>
2040 template<
typename _Tp>
2044 template<std::
size_t _Len>
2045 struct __aligned_storage_msa
2049 unsigned char __data[_Len];
2050 struct __attribute__((__aligned__)) { } __align;
2064 template<std::size_t _Len, std::size_t _Align =
2065 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2070 unsigned char __data[_Len];
2071 struct __attribute__((__aligned__((_Align)))) { } __align;
2075 template <
typename... _Types>
2076 struct __strictest_alignment
2078 static const size_t _S_alignment = 0;
2079 static const size_t _S_size = 0;
2082 template <
typename _Tp,
typename... _Types>
2083 struct __strictest_alignment<_Tp, _Types...>
2085 static const size_t _S_alignment =
2086 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2087 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2088 static const size_t _S_size =
2089 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2090 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2103 template <
size_t _Len,
typename... _Types>
2107 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2109 using __strictest = __strictest_alignment<_Types...>;
2110 static const size_t _S_len = _Len > __strictest::_S_size
2111 ? _Len : __strictest::_S_size;
2114 static const size_t alignment_value = __strictest::_S_alignment;
2119 template <
size_t _Len,
typename... _Types>
2120 const size_t aligned_union<_Len, _Types...>::alignment_value;
2124 template<
typename _Up,
2127 struct __decay_selector;
2130 template<
typename _Up>
2131 struct __decay_selector<_Up, false, false>
2132 {
typedef __remove_cv_t<_Up> __type; };
2134 template<
typename _Up>
2135 struct __decay_selector<_Up, true, false>
2136 {
typedef typename remove_extent<_Up>::type* __type; };
2138 template<
typename _Up>
2139 struct __decay_selector<_Up, false, true>
2140 {
typedef typename add_pointer<_Up>::type __type; };
2143 template<
typename _Tp>
2146 typedef typename remove_reference<_Tp>::type __remove_type;
2149 typedef typename __decay_selector<__remove_type>::__type type;
2153 template<
typename _Tp>
2154 using __decay_t =
typename decay<_Tp>::type;
2156 template<
typename _Tp>
2160 template<
typename _Tp>
2161 struct __strip_reference_wrapper
2166 template<
typename _Tp>
2169 typedef _Tp& __type;
2172 template<
typename _Tp>
2173 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2178 template<
bool,
typename _Tp =
void>
2183 template<
typename _Tp>
2185 {
typedef _Tp type; };
2188 template<
bool _Cond,
typename _Tp =
void>
2189 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
2191 template<
typename... _Cond>
2192 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2196 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2198 {
typedef _Iftrue type; };
2201 template<
typename _Iftrue,
typename _Iffalse>
2202 struct conditional<false, _Iftrue, _Iffalse>
2203 {
typedef _Iffalse type; };
2206 template<
typename _Tp>
2207 using __remove_cvref_t
2208 =
typename remove_cv<typename remove_reference<_Tp>::type>::type;
2211 template<
typename... _Tp>
2216 struct __do_common_type_impl
2218 template<
typename _Tp,
typename _Up>
2220 = decltype(
true ? std::declval<_Tp>() : std::declval<_Up>());
2224 template<
typename _Tp,
typename _Up>
2225 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2228 #if __cplusplus > 201703L
2231 template<
typename _Tp,
typename _Up>
2232 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2236 template<
typename,
typename>
2237 static __failure_type
2240 template<
typename _Tp,
typename _Up>
2241 static decltype(_S_test_2<_Tp, _Up>(0))
2251 template<
typename _Tp0>
2257 template<
typename _Tp1,
typename _Tp2,
2258 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2259 struct __common_type_impl
2263 using type = common_type<_Dp1, _Dp2>;
2266 template<
typename _Tp1,
typename _Tp2>
2267 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2268 :
private __do_common_type_impl
2272 using type = decltype(_S_test<_Tp1, _Tp2>(0));
2276 template<
typename _Tp1,
typename _Tp2>
2277 struct common_type<_Tp1, _Tp2>
2278 :
public __common_type_impl<_Tp1, _Tp2>::type
2281 template<
typename...>
2282 struct __common_type_pack
2285 template<
typename,
typename,
typename =
void>
2286 struct __common_type_fold;
2289 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2290 struct common_type<_Tp1, _Tp2, _Rp...>
2291 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2292 __common_type_pack<_Rp...>>
2298 template<
typename _CTp,
typename... _Rp>
2299 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2300 __void_t<typename _CTp::type>>
2301 :
public common_type<typename _CTp::type, _Rp...>
2305 template<
typename _CTp,
typename _Rp>
2306 struct __common_type_fold<_CTp, _Rp, void>
2309 template<typename _Tp, bool = is_enum<_Tp>::value>
2310 struct __underlying_type_impl
2312 using type = __underlying_type(_Tp);
2315 template<
typename _Tp>
2316 struct __underlying_type_impl<_Tp, false>
2320 template<
typename _Tp>
2322 :
public __underlying_type_impl<_Tp>
2325 template<
typename _Tp>
2326 struct __declval_protector
2328 static const bool __stop =
false;
2331 template<
typename _Tp>
2332 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2334 static_assert(__declval_protector<_Tp>::__stop,
2335 "declval() must not be used!");
2336 return __declval<_Tp>(0);
2340 template<
typename _Signature>
2345 #define __cpp_lib_result_of_sfinae 201210
2347 struct __invoke_memfun_ref { };
2348 struct __invoke_memfun_deref { };
2349 struct __invoke_memobj_ref { };
2350 struct __invoke_memobj_deref { };
2351 struct __invoke_other { };
2354 template<
typename _Tp,
typename _Tag>
2355 struct __result_of_success : __success_type<_Tp>
2356 {
using __invoke_type = _Tag; };
2359 struct __result_of_memfun_ref_impl
2361 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2362 static __result_of_success<decltype(
2363 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2364 ), __invoke_memfun_ref> _S_test(
int);
2366 template<
typename...>
2367 static __failure_type _S_test(...);
2370 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2371 struct __result_of_memfun_ref
2372 :
private __result_of_memfun_ref_impl
2374 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2378 struct __result_of_memfun_deref_impl
2380 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2381 static __result_of_success<decltype(
2382 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2383 ), __invoke_memfun_deref> _S_test(
int);
2385 template<
typename...>
2386 static __failure_type _S_test(...);
2389 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2390 struct __result_of_memfun_deref
2391 :
private __result_of_memfun_deref_impl
2393 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2397 struct __result_of_memobj_ref_impl
2399 template<
typename _Fp,
typename _Tp1>
2400 static __result_of_success<decltype(
2401 std::declval<_Tp1>().*std::declval<_Fp>()
2402 ), __invoke_memobj_ref> _S_test(
int);
2404 template<
typename,
typename>
2405 static __failure_type _S_test(...);
2408 template<
typename _MemPtr,
typename _Arg>
2409 struct __result_of_memobj_ref
2410 :
private __result_of_memobj_ref_impl
2412 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2416 struct __result_of_memobj_deref_impl
2418 template<
typename _Fp,
typename _Tp1>
2419 static __result_of_success<decltype(
2420 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2421 ), __invoke_memobj_deref> _S_test(
int);
2423 template<
typename,
typename>
2424 static __failure_type _S_test(...);
2427 template<
typename _MemPtr,
typename _Arg>
2428 struct __result_of_memobj_deref
2429 :
private __result_of_memobj_deref_impl
2431 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2434 template<typename _MemPtr, typename _Arg>
2435 struct __result_of_memobj;
2437 template<typename _Res, typename _Class, typename _Arg>
2438 struct __result_of_memobj<_Res _Class::*, _Arg>
2440 typedef __remove_cvref_t<_Arg> _Argval;
2441 typedef _Res _Class::* _MemPtr;
2442 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2443 is_base_of<_Class, _Argval>>::value,
2444 __result_of_memobj_ref<_MemPtr, _Arg>,
2445 __result_of_memobj_deref<_MemPtr, _Arg>
2449 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2450 struct __result_of_memfun;
2452 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2453 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2455 typedef typename remove_reference<_Arg>::type _Argval;
2456 typedef _Res _Class::* _MemPtr;
2457 typedef typename conditional<is_base_of<_Class, _Argval>::value,
2458 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2459 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2468 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2474 template<
typename _Tp,
typename _Up>
2475 struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
2480 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2481 struct __result_of_impl
2483 typedef __failure_type type;
2486 template<
typename _MemPtr,
typename _Arg>
2487 struct __result_of_impl<true, false, _MemPtr, _Arg>
2488 :
public __result_of_memobj<__decay_t<_MemPtr>,
2489 typename __inv_unwrap<_Arg>::type>
2492 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2493 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2494 :
public __result_of_memfun<__decay_t<_MemPtr>,
2495 typename __inv_unwrap<_Arg>::type, _Args...>
2499 struct __result_of_other_impl
2501 template<
typename _Fn,
typename... _Args>
2502 static __result_of_success<decltype(
2503 std::declval<_Fn>()(std::declval<_Args>()...)
2504 ), __invoke_other> _S_test(
int);
2506 template<
typename...>
2507 static __failure_type _S_test(...);
2510 template<
typename _Functor,
typename... _ArgTypes>
2511 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2512 :
private __result_of_other_impl
2514 typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2518 template<typename _Functor, typename... _ArgTypes>
2519 struct __invoke_result
2520 : public __result_of_impl<
2521 is_member_object_pointer<
2522 typename remove_reference<_Functor>::type
2524 is_member_function_pointer<
2525 typename remove_reference<_Functor>::type
2527 _Functor, _ArgTypes...
2531 template<
typename _Functor,
typename... _ArgTypes>
2532 struct result_of<_Functor(_ArgTypes...)>
2533 :
public __invoke_result<_Functor, _ArgTypes...>
2536 #if __cplusplus >= 201402L
2538 template<
size_t _Len,
size_t _Align =
2539 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2542 template <
size_t _Len,
typename... _Types>
2543 using aligned_union_t =
typename aligned_union<_Len, _Types...>::type;
2546 template<
typename _Tp>
2550 template<
bool _Cond,
typename _Tp =
void>
2554 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2558 template<
typename... _Tp>
2562 template<
typename _Tp>
2566 template<
typename _Tp>
2570 #if __cplusplus >= 201703L || !defined(__STRICT_ANSI__) // c++17 or gnu++11
2571 #define __cpp_lib_void_t 201411
2577 template<
typename _Default,
typename _AlwaysVoid,
2578 template<
typename...>
class _Op,
typename... _Args>
2582 using type = _Default;
2586 template<
typename _Default,
template<
typename...>
class _Op,
2588 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2591 using type = _Op<_Args...>;
2595 template<
typename _Default,
template<
typename...>
class _Op,
2600 template<
typename _Default,
template<
typename...>
class _Op,
2602 using __detected_or_t
2611 #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2612 template<typename _Tp, typename = __void_t<>> \
2613 struct __has_##_NTYPE \
2616 template<typename _Tp> \
2617 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
2621 template <
typename _Tp>
2622 struct __is_swappable;
2624 template <
typename _Tp>
2625 struct __is_nothrow_swappable;
2627 template<
typename... _Elements>
2634 template<
typename... _Tps>
2635 struct __is_tuple_like_impl<tuple<_Tps...>> :
true_type
2639 template<
typename _Tp>
2640 struct __is_tuple_like
2641 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
2644 template<
typename _Tp>
2645 _GLIBCXX20_CONSTEXPR
2647 _Require<__not_<__is_tuple_like<_Tp>>,
2648 is_move_constructible<_Tp>,
2649 is_move_assignable<_Tp>>
2651 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2652 is_nothrow_move_assignable<_Tp>>::value);
2654 template<
typename _Tp,
size_t _Nm>
2655 _GLIBCXX20_CONSTEXPR
2657 __enable_if_t<__is_swappable<_Tp>::value>
2658 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2659 noexcept(__is_nothrow_swappable<_Tp>::value);
2661 namespace __swappable_details {
2664 struct __do_is_swappable_impl
2666 template<
typename _Tp,
typename
2667 = decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2674 struct __do_is_nothrow_swappable_impl
2676 template<
typename _Tp>
2677 static __bool_constant<
2678 noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2687 template<
typename _Tp>
2688 struct __is_swappable_impl
2689 :
public __swappable_details::__do_is_swappable_impl
2691 typedef decltype(__test<_Tp>(0)) type;
2694 template<typename _Tp>
2695 struct __is_nothrow_swappable_impl
2696 : public __swappable_details::__do_is_nothrow_swappable_impl
2698 typedef decltype(__test<_Tp>(0)) type;
2701 template<typename _Tp>
2702 struct __is_swappable
2703 : public __is_swappable_impl<_Tp>::type
2706 template<
typename _Tp>
2707 struct __is_nothrow_swappable
2708 :
public __is_nothrow_swappable_impl<_Tp>::type
2711 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
2712 #define __cpp_lib_is_swappable 201603
2716 template<
typename _Tp>
2718 :
public __is_swappable_impl<_Tp>::type
2720 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2721 "template argument must be a complete class or an unbounded array");
2725 template<
typename _Tp>
2727 :
public __is_nothrow_swappable_impl<_Tp>::type
2729 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2730 "template argument must be a complete class or an unbounded array");
2733 #if __cplusplus >= 201402L
2735 template<
typename _Tp>
2740 template<
typename _Tp>
2743 #endif // __cplusplus >= 201402L
2745 namespace __swappable_with_details {
2748 struct __do_is_swappable_with_impl
2750 template<
typename _Tp,
typename _Up,
typename
2751 = decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
2753 = decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
2756 template<
typename,
typename>
2760 struct __do_is_nothrow_swappable_with_impl
2762 template<
typename _Tp,
typename _Up>
2764 noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
2766 noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
2769 template<
typename,
typename>
2775 template<
typename _Tp,
typename _Up>
2776 struct __is_swappable_with_impl
2777 :
public __swappable_with_details::__do_is_swappable_with_impl
2779 typedef decltype(__test<_Tp, _Up>(0)) type;
2783 template<typename _Tp>
2784 struct __is_swappable_with_impl<_Tp&, _Tp&>
2785 : public __swappable_details::__do_is_swappable_impl
2787 typedef decltype(__test<_Tp&>(0)) type;
2790 template<typename _Tp, typename _Up>
2791 struct __is_nothrow_swappable_with_impl
2792 : public __swappable_with_details::__do_is_nothrow_swappable_with_impl
2794 typedef decltype(__test<_Tp, _Up>(0)) type;
2798 template<typename _Tp>
2799 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
2800 : public __swappable_details::__do_is_nothrow_swappable_impl
2802 typedef decltype(__test<_Tp&>(0)) type;
2806 template<typename _Tp, typename _Up>
2808 : public __is_swappable_with_impl<_Tp, _Up>::type
2812 template<
typename _Tp,
typename _Up>
2814 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
2817 #if __cplusplus >= 201402L
2819 template<
typename _Tp,
typename _Up>
2824 template<
typename _Tp,
typename _Up>
2827 #endif // __cplusplus >= 201402L
2829 #endif// c++1z or gnu++11
2834 template<
typename _Result,
typename _Ret,
2839 template<
typename _Result,
typename _Ret>
2840 struct __is_invocable_impl<_Result, _Ret,
2842 __void_t<typename _Result::type>>
2846 #pragma GCC diagnostic push
2847 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2849 template<
typename _Result,
typename _Ret>
2850 struct __is_invocable_impl<_Result, _Ret,
2852 __void_t<typename _Result::type>>
2857 static typename _Result::type _S_get();
2859 template<
typename _Tp>
2860 static void _S_conv(_Tp);
2863 template<typename _Tp, typename = decltype(_S_conv<_Tp>(_S_get()))>
2867 template<
typename _Tp>
2872 using type = decltype(_S_test<_Ret>(1));
2874 #pragma GCC diagnostic pop
2876 template<
typename _Fn,
typename... _ArgTypes>
2877 struct __is_invocable
2878 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2881 template<
typename _Fn,
typename _Tp,
typename... _Args>
2882 constexpr
bool __call_is_nt(__invoke_memfun_ref)
2884 using _Up =
typename __inv_unwrap<_Tp>::type;
2885 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
2886 std::declval<_Args>()...));
2889 template<
typename _Fn,
typename _Tp,
typename... _Args>
2890 constexpr
bool __call_is_nt(__invoke_memfun_deref)
2892 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
2893 std::declval<_Args>()...));
2896 template<
typename _Fn,
typename _Tp>
2897 constexpr
bool __call_is_nt(__invoke_memobj_ref)
2899 using _Up =
typename __inv_unwrap<_Tp>::type;
2900 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
2903 template<
typename _Fn,
typename _Tp>
2904 constexpr
bool __call_is_nt(__invoke_memobj_deref)
2906 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
2909 template<
typename _Fn,
typename... _Args>
2910 constexpr
bool __call_is_nt(__invoke_other)
2912 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
2915 template<
typename _Result,
typename _Fn,
typename... _Args>
2916 struct __call_is_nothrow
2918 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
2922 template<
typename _Fn,
typename... _Args>
2923 using __call_is_nothrow_
2924 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
2927 template<
typename _Fn,
typename... _Args>
2928 struct __is_nothrow_invocable
2929 : __and_<__is_invocable<_Fn, _Args...>,
2930 __call_is_nothrow_<_Fn, _Args...>>::type
2933 #pragma GCC diagnostic push
2934 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2935 struct __nonesuchbase {};
2936 struct __nonesuch :
private __nonesuchbase {
2937 ~__nonesuch() =
delete;
2938 __nonesuch(__nonesuch
const&) =
delete;
2939 void operator=(__nonesuch
const&) =
delete;
2941 #pragma GCC diagnostic pop
2943 #if __cplusplus >= 201703L
2944 # define __cpp_lib_is_invocable 201703
2947 template<
typename _Functor,
typename... _ArgTypes>
2948 struct invoke_result
2949 :
public __invoke_result<_Functor, _ArgTypes...>
2953 template<
typename _Fn,
typename... _Args>
2954 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
2957 template<
typename _Fn,
typename... _ArgTypes>
2959 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2961 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2962 "_Fn must be a complete class or an unbounded array");
2966 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2967 struct is_invocable_r
2968 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
2970 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2971 "_Fn must be a complete class or an unbounded array");
2975 template<
typename _Fn,
typename... _ArgTypes>
2976 struct is_nothrow_invocable
2977 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
2978 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2980 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2981 "_Fn must be a complete class or an unbounded array");
2984 template<
typename _Result,
typename _Ret,
typename =
void>
2985 struct __is_nt_invocable_impl :
false_type { };
2987 template<
typename _Result,
typename _Ret>
2988 struct __is_nt_invocable_impl<_Result, _Ret,
2989 __void_t<typename _Result::type>>
2990 : __or_<is_void<_Ret>,
2991 __is_nothrow_convertible<typename _Result::type, _Ret>>
2995 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2996 struct is_nothrow_invocable_r
2997 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
2998 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3002 template<
typename _Fn,
typename... _Args>
3003 inline constexpr
bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
3006 template<
typename _Fn,
typename... _Args>
3007 inline constexpr
bool is_nothrow_invocable_v
3008 = is_nothrow_invocable<_Fn, _Args...>::value;
3011 template<
typename _Ret,
typename _Fn,
typename... _Args>
3012 inline constexpr
bool is_invocable_r_v
3013 = is_invocable_r<_Ret, _Fn, _Args...>::value;
3016 template<
typename _Ret,
typename _Fn,
typename... _Args>
3017 inline constexpr
bool is_nothrow_invocable_r_v
3018 = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3021 #if __cplusplus >= 201703L
3022 # define __cpp_lib_type_trait_variable_templates 201510L
3023 template <
typename _Tp>
3024 inline constexpr
bool is_void_v = is_void<_Tp>::value;
3025 template <
typename _Tp>
3026 inline constexpr
bool is_null_pointer_v = is_null_pointer<_Tp>::value;
3027 template <
typename _Tp>
3028 inline constexpr
bool is_integral_v = is_integral<_Tp>::value;
3029 template <
typename _Tp>
3030 inline constexpr
bool is_floating_point_v = is_floating_point<_Tp>::value;
3031 template <
typename _Tp>
3032 inline constexpr
bool is_array_v = is_array<_Tp>::value;
3033 template <
typename _Tp>
3034 inline constexpr
bool is_pointer_v = is_pointer<_Tp>::value;
3035 template <
typename _Tp>
3036 inline constexpr
bool is_lvalue_reference_v =
3037 is_lvalue_reference<_Tp>::value;
3038 template <
typename _Tp>
3039 inline constexpr
bool is_rvalue_reference_v =
3040 is_rvalue_reference<_Tp>::value;
3041 template <
typename _Tp>
3042 inline constexpr
bool is_member_object_pointer_v =
3043 is_member_object_pointer<_Tp>::value;
3044 template <
typename _Tp>
3045 inline constexpr
bool is_member_function_pointer_v =
3046 is_member_function_pointer<_Tp>::value;
3047 template <
typename _Tp>
3048 inline constexpr
bool is_enum_v = is_enum<_Tp>::value;
3049 template <
typename _Tp>
3050 inline constexpr
bool is_union_v = is_union<_Tp>::value;
3051 template <
typename _Tp>
3052 inline constexpr
bool is_class_v = is_class<_Tp>::value;
3053 template <
typename _Tp>
3054 inline constexpr
bool is_function_v = is_function<_Tp>::value;
3055 template <
typename _Tp>
3056 inline constexpr
bool is_reference_v = is_reference<_Tp>::value;
3057 template <
typename _Tp>
3058 inline constexpr
bool is_arithmetic_v = is_arithmetic<_Tp>::value;
3059 template <
typename _Tp>
3060 inline constexpr
bool is_fundamental_v = is_fundamental<_Tp>::value;
3061 template <
typename _Tp>
3062 inline constexpr
bool is_object_v = is_object<_Tp>::value;
3063 template <
typename _Tp>
3064 inline constexpr
bool is_scalar_v = is_scalar<_Tp>::value;
3065 template <
typename _Tp>
3066 inline constexpr
bool is_compound_v = is_compound<_Tp>::value;
3067 template <
typename _Tp>
3068 inline constexpr
bool is_member_pointer_v = is_member_pointer<_Tp>::value;
3069 template <
typename _Tp>
3070 inline constexpr
bool is_const_v = is_const<_Tp>::value;
3071 template <
typename _Tp>
3072 inline constexpr
bool is_volatile_v = is_volatile<_Tp>::value;
3073 template <
typename _Tp>
3074 inline constexpr
bool is_trivial_v = is_trivial<_Tp>::value;
3075 template <
typename _Tp>
3076 inline constexpr
bool is_trivially_copyable_v =
3077 is_trivially_copyable<_Tp>::value;
3078 template <
typename _Tp>
3079 inline constexpr
bool is_standard_layout_v = is_standard_layout<_Tp>::value;
3080 template <
typename _Tp>
3081 inline constexpr
bool is_pod_v = is_pod<_Tp>::value;
3082 template <
typename _Tp>
3083 inline constexpr
bool is_literal_type_v = is_literal_type<_Tp>::value;
3084 template <
typename _Tp>
3085 inline constexpr
bool is_empty_v = is_empty<_Tp>::value;
3086 template <
typename _Tp>
3087 inline constexpr
bool is_polymorphic_v = is_polymorphic<_Tp>::value;
3088 template <
typename _Tp>
3089 inline constexpr
bool is_abstract_v = is_abstract<_Tp>::value;
3090 template <
typename _Tp>
3091 inline constexpr
bool is_final_v = is_final<_Tp>::value;
3092 template <
typename _Tp>
3093 inline constexpr
bool is_signed_v = is_signed<_Tp>::value;
3094 template <
typename _Tp>
3095 inline constexpr
bool is_unsigned_v = is_unsigned<_Tp>::value;
3096 template <
typename _Tp,
typename... _Args>
3097 inline constexpr
bool is_constructible_v =
3098 is_constructible<_Tp, _Args...>::value;
3099 template <
typename _Tp>
3100 inline constexpr
bool is_default_constructible_v =
3101 is_default_constructible<_Tp>::value;
3102 template <
typename _Tp>
3103 inline constexpr
bool is_copy_constructible_v =
3104 is_copy_constructible<_Tp>::value;
3105 template <
typename _Tp>
3106 inline constexpr
bool is_move_constructible_v =
3107 is_move_constructible<_Tp>::value;
3108 template <
typename _Tp,
typename _Up>
3109 inline constexpr
bool is_assignable_v = is_assignable<_Tp, _Up>::value;
3110 template <
typename _Tp>
3111 inline constexpr
bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
3112 template <
typename _Tp>
3113 inline constexpr
bool is_move_assignable_v = is_move_assignable<_Tp>::value;
3114 template <
typename _Tp>
3115 inline constexpr
bool is_destructible_v = is_destructible<_Tp>::value;
3116 template <
typename _Tp,
typename... _Args>
3117 inline constexpr
bool is_trivially_constructible_v =
3118 is_trivially_constructible<_Tp, _Args...>::value;
3119 template <
typename _Tp>
3120 inline constexpr
bool is_trivially_default_constructible_v =
3121 is_trivially_default_constructible<_Tp>::value;
3122 template <
typename _Tp>
3123 inline constexpr
bool is_trivially_copy_constructible_v =
3124 is_trivially_copy_constructible<_Tp>::value;
3125 template <
typename _Tp>
3126 inline constexpr
bool is_trivially_move_constructible_v =
3127 is_trivially_move_constructible<_Tp>::value;
3128 template <
typename _Tp,
typename _Up>
3129 inline constexpr
bool is_trivially_assignable_v =
3130 is_trivially_assignable<_Tp, _Up>::value;
3131 template <
typename _Tp>
3132 inline constexpr
bool is_trivially_copy_assignable_v =
3133 is_trivially_copy_assignable<_Tp>::value;
3134 template <
typename _Tp>
3135 inline constexpr
bool is_trivially_move_assignable_v =
3136 is_trivially_move_assignable<_Tp>::value;
3137 template <
typename _Tp>
3138 inline constexpr
bool is_trivially_destructible_v =
3139 is_trivially_destructible<_Tp>::value;
3140 template <
typename _Tp,
typename... _Args>
3141 inline constexpr
bool is_nothrow_constructible_v =
3142 is_nothrow_constructible<_Tp, _Args...>::value;
3143 template <
typename _Tp>
3144 inline constexpr
bool is_nothrow_default_constructible_v =
3145 is_nothrow_default_constructible<_Tp>::value;
3146 template <
typename _Tp>
3147 inline constexpr
bool is_nothrow_copy_constructible_v =
3148 is_nothrow_copy_constructible<_Tp>::value;
3149 template <
typename _Tp>
3150 inline constexpr
bool is_nothrow_move_constructible_v =
3151 is_nothrow_move_constructible<_Tp>::value;
3152 template <
typename _Tp,
typename _Up>
3153 inline constexpr
bool is_nothrow_assignable_v =
3154 is_nothrow_assignable<_Tp, _Up>::value;
3155 template <
typename _Tp>
3156 inline constexpr
bool is_nothrow_copy_assignable_v =
3157 is_nothrow_copy_assignable<_Tp>::value;
3158 template <
typename _Tp>
3159 inline constexpr
bool is_nothrow_move_assignable_v =
3160 is_nothrow_move_assignable<_Tp>::value;
3161 template <
typename _Tp>
3162 inline constexpr
bool is_nothrow_destructible_v =
3163 is_nothrow_destructible<_Tp>::value;
3164 template <
typename _Tp>
3165 inline constexpr
bool has_virtual_destructor_v =
3166 has_virtual_destructor<_Tp>::value;
3167 template <
typename _Tp>
3168 inline constexpr
size_t alignment_of_v = alignment_of<_Tp>::value;
3169 template <
typename _Tp>
3170 inline constexpr
size_t rank_v = rank<_Tp>::value;
3171 template <
typename _Tp,
unsigned _Idx = 0>
3172 inline constexpr
size_t extent_v = extent<_Tp, _Idx>::value;
3173 #ifdef _GLIBCXX_BUILTIN_IS_SAME_AS
3174 template <
typename _Tp,
typename _Up>
3175 inline constexpr
bool is_same_v = _GLIBCXX_BUILTIN_IS_SAME_AS(_Tp, _Up);
3177 template <
typename _Tp,
typename _Up>
3180 template <
typename _Base,
typename _Derived>
3181 inline constexpr
bool is_base_of_v = is_base_of<_Base, _Derived>::value;
3182 template <
typename _From,
typename _To>
3183 inline constexpr
bool is_convertible_v = is_convertible<_From, _To>::value;
3185 #ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
3186 # define __cpp_lib_has_unique_object_representations 201606
3188 template<
typename _Tp>
3189 struct has_unique_object_representations
3190 : bool_constant<__has_unique_object_representations(
3191 remove_cv_t<remove_all_extents_t<_Tp>>
3194 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3195 "template argument must be a complete class or an unbounded array");
3198 template<
typename _Tp>
3199 inline constexpr
bool has_unique_object_representations_v
3200 = has_unique_object_representations<_Tp>::value;
3203 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
3204 # define __cpp_lib_is_aggregate 201703
3206 template<
typename _Tp>
3208 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3212 template<
typename _Tp>
3213 inline constexpr
bool is_aggregate_v = is_aggregate<_Tp>::value;
3217 #if __cplusplus > 201703L
3219 template<
typename _Tp>
3222 using type = __remove_cvref_t<_Tp>;
3225 template<
typename _Tp>
3226 using remove_cvref_t = __remove_cvref_t<_Tp>;
3229 template<
typename _Tp>
3230 struct type_identity {
using type = _Tp; };
3232 template<
typename _Tp>
3233 using type_identity_t =
typename type_identity<_Tp>::type;
3236 template<
typename _Tp>
3237 struct unwrap_reference {
using type = _Tp; };
3239 template<
typename _Tp>
3240 struct unwrap_reference<reference_wrapper<_Tp>> {
using type = _Tp&; };
3242 template<
typename _Tp>
3243 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3246 template<
typename _Tp>
3247 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
3249 template<
typename _Tp>
3250 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3252 #define __cpp_lib_bounded_array_traits 201902L
3255 template<
typename _Tp>
3256 struct is_bounded_array
3257 :
public __is_array_known_bounds<_Tp>
3261 template<
typename _Tp>
3262 struct is_unbounded_array
3263 :
public __is_array_unknown_bounds<_Tp>
3266 template<
typename _Tp>
3267 inline constexpr
bool is_bounded_array_v
3268 = is_bounded_array<_Tp>::value;
3270 template<
typename _Tp>
3271 inline constexpr
bool is_unbounded_array_v
3272 = is_unbounded_array<_Tp>::value;
3274 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
3276 #define __cpp_lib_is_constant_evaluated 201811L
3278 constexpr
inline bool
3279 is_constant_evaluated() noexcept
3280 {
return __builtin_is_constant_evaluated(); }
3283 template<
typename _From,
typename _To>
3284 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
3286 template<
typename _Xp,
typename _Yp>
3288 = decltype(
false ? declval<_Xp(&)()>()() : declval<_Yp(&)()>()());
3290 template<
typename _Ap,
typename _Bp,
typename =
void>
3291 struct __common_ref_impl
3295 template<
typename _Ap,
typename _Bp>
3296 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
3299 template<
typename _Xp,
typename _Yp>
3300 struct __common_ref_impl<_Xp&, _Yp&,
3301 __void_t<__cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>>>
3302 {
using type = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>; };
3305 template<
typename _Xp,
typename _Yp>
3306 using __common_ref_C = remove_reference_t<__common_ref<_Xp&, _Yp&>>&&;
3309 template<
typename _Xp,
typename _Yp>
3310 struct __common_ref_impl<_Xp&&, _Yp&&,
3311 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
3312 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
3313 {
using type = __common_ref_C<_Xp, _Yp>; };
3316 template<
typename _Xp,
typename _Yp>
3317 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
3320 template<
typename _Xp,
typename _Yp>
3321 struct __common_ref_impl<_Xp&&, _Yp&,
3322 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
3323 {
using type = __common_ref_D<_Xp, _Yp>; };
3326 template<
typename _Xp,
typename _Yp>
3327 struct __common_ref_impl<_Xp&, _Yp&&>
3328 : __common_ref_impl<_Yp&&, _Xp&>
3331 template<
typename _Tp,
typename _Up,
3332 template<
typename>
class _TQual,
template<
typename>
class _UQual>
3333 struct basic_common_reference
3336 template<
typename _Tp>
3338 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
3340 template<
typename _Tp>
3342 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
3344 template<
typename _Tp>
3345 struct __xref<_Tp&&>
3346 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
3348 template<
typename _Tp1,
typename _Tp2>
3349 using __basic_common_ref
3350 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
3351 remove_cvref_t<_Tp2>,
3352 __xref<_Tp1>::template __type,
3353 __xref<_Tp2>::template __type>::type;
3355 template<
typename... _Tp>
3356 struct common_reference;
3358 template<
typename... _Tp>
3359 using common_reference_t =
typename common_reference<_Tp...>::type;
3363 struct common_reference<>
3367 template<
typename _Tp0>
3368 struct common_reference<_Tp0>
3369 {
using type = _Tp0; };
3371 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1,
typename =
void>
3372 struct __common_reference_impl
3373 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
3377 template<
typename _Tp1,
typename _Tp2>
3378 struct common_reference<_Tp1, _Tp2>
3379 : __common_reference_impl<_Tp1, _Tp2>
3383 template<
typename _Tp1,
typename _Tp2>
3384 struct __common_reference_impl<_Tp1&, _Tp2&, 1,
3385 void_t<__common_ref<_Tp1&, _Tp2&>>>
3386 {
using type = __common_ref<_Tp1&, _Tp2&>; };
3388 template<
typename _Tp1,
typename _Tp2>
3389 struct __common_reference_impl<_Tp1&&, _Tp2&&, 1,
3390 void_t<__common_ref<_Tp1&&, _Tp2&&>>>
3391 {
using type = __common_ref<_Tp1&&, _Tp2&&>; };
3393 template<
typename _Tp1,
typename _Tp2>
3394 struct __common_reference_impl<_Tp1&, _Tp2&&, 1,
3395 void_t<__common_ref<_Tp1&, _Tp2&&>>>
3396 {
using type = __common_ref<_Tp1&, _Tp2&&>; };
3398 template<
typename _Tp1,
typename _Tp2>
3399 struct __common_reference_impl<_Tp1&&, _Tp2&, 1,
3400 void_t<__common_ref<_Tp1&&, _Tp2&>>>
3401 {
using type = __common_ref<_Tp1&&, _Tp2&>; };
3404 template<
typename _Tp1,
typename _Tp2>
3405 struct __common_reference_impl<_Tp1, _Tp2, 2,
3406 void_t<__basic_common_ref<_Tp1, _Tp2>>>
3407 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
3410 template<
typename _Tp1,
typename _Tp2>
3411 struct __common_reference_impl<_Tp1, _Tp2, 3,
3412 void_t<__cond_res<_Tp1, _Tp2>>>
3413 {
using type = __cond_res<_Tp1, _Tp2>; };
3416 template<
typename _Tp1,
typename _Tp2>
3417 struct __common_reference_impl<_Tp1, _Tp2, 4,
3419 {
using type = common_type_t<_Tp1, _Tp2>; };
3422 template<
typename _Tp1,
typename _Tp2>
3423 struct __common_reference_impl<_Tp1, _Tp2, 5, void>
3427 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3428 struct common_reference<_Tp1, _Tp2, _Rest...>
3429 : __common_type_fold<common_reference<_Tp1, _Tp2>,
3430 __common_type_pack<_Rest...>>
3434 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3435 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
3436 __common_type_pack<_Rest...>,
3437 void_t<common_reference_t<_Tp1, _Tp2>>>
3438 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
3443 _GLIBCXX_END_NAMESPACE_VERSION
3448 #endif // _GLIBCXX_TYPE_TRAITS