29#ifndef _GLIBCXX_TYPE_TRAITS
30#define _GLIBCXX_TYPE_TRAITS 1
32#pragma GCC system_header
34#if __cplusplus < 201103L
40namespace 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>
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>
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
626 template<
typename _Tp>
627 using __is_standard_integer
628 = __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>;
631 template<
typename...>
using __void_t = void;
635 template<
typename _Tp,
typename =
void>
636 struct __is_referenceable
640 template<
typename _Tp>
641 struct __is_referenceable<_Tp, __void_t<_Tp&>>
652 template<
typename _Tp>
661 template<
typename _Tp>
666 template<
typename _Tp>
670 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
671 "template argument must be a complete class or an unbounded array");
675 template<
typename _Tp>
676 struct is_trivially_copyable
679 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
680 "template argument must be a complete class or an unbounded array");
684 template<
typename _Tp>
688 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
689 "template argument must be a complete class or an unbounded array");
694 template<
typename _Tp>
696 _GLIBCXX20_DEPRECATED(
"use is_standard_layout && is_trivial instead")
700 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
701 "template argument must be a complete class or an unbounded array");
705 template<
typename _Tp>
709 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
710 "template argument must be a complete class or an unbounded array");
714 template<
typename _Tp>
720 template<
typename _Tp>
725#if __cplusplus >= 201402L
726#define __cpp_lib_is_final 201402L
728 template<
typename _Tp>
735 template<
typename _Tp>
740 template<
typename _Tp,
742 struct __is_signed_helper
745 template<
typename _Tp>
746 struct __is_signed_helper<_Tp, true>
747 :
public integral_constant<bool, _Tp(-1) < _Tp(0)>
751 template<typename _Tp>
753 : public __is_signed_helper<_Tp>::type
757 template<typename _Tp>
759 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>
770 template<typename _Tp, typename _Up = _Tp&&>
774 template<typename _Tp>
778 template<typename _Tp>
779 auto declval() noexcept -> decltype(__declval<_Tp>(0));
781 template<typename, unsigned = 0>
785 struct remove_all_extents;
787 template<typename _Tp>
788 struct __is_array_known_bounds
789 :
public integral_constant<bool, (extent<_Tp>::value > 0)>
792 template<
typename _Tp>
793 struct __is_array_unknown_bounds
794 :
public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
802 struct __do_is_destructible_impl
804 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
811 template<
typename _Tp>
812 struct __is_destructible_impl
813 :
public __do_is_destructible_impl
815 typedef decltype(__test<_Tp>(0)) type;
818 template<
typename _Tp,
819 bool = __or_<is_void<_Tp>,
820 __is_array_unknown_bounds<_Tp>,
821 is_function<_Tp>>::value,
822 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
823 struct __is_destructible_safe;
825 template<
typename _Tp>
826 struct __is_destructible_safe<_Tp, false, false>
827 :
public __is_destructible_impl<typename
828 remove_all_extents<_Tp>::type>::type
831 template<
typename _Tp>
832 struct __is_destructible_safe<_Tp, true, false>
835 template<
typename _Tp>
836 struct __is_destructible_safe<_Tp, false, true>
840 template<
typename _Tp>
842 :
public __is_destructible_safe<_Tp>::type
844 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
845 "template argument must be a complete class or an unbounded array");
852 struct __do_is_nt_destructible_impl
854 template<
typename _Tp>
862 template<
typename _Tp>
863 struct __is_nt_destructible_impl
864 :
public __do_is_nt_destructible_impl
866 typedef decltype(__test<_Tp>(0)) type;
869 template<
typename _Tp,
870 bool = __or_<is_void<_Tp>,
871 __is_array_unknown_bounds<_Tp>,
872 is_function<_Tp>>::value,
873 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
874 struct __is_nt_destructible_safe;
876 template<
typename _Tp>
877 struct __is_nt_destructible_safe<_Tp, false, false>
878 :
public __is_nt_destructible_impl<typename
879 remove_all_extents<_Tp>::type>::type
882 template<
typename _Tp>
883 struct __is_nt_destructible_safe<_Tp, true, false>
886 template<
typename _Tp>
887 struct __is_nt_destructible_safe<_Tp, false, true>
891 template<
typename _Tp>
893 :
public __is_nt_destructible_safe<_Tp>::type
895 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
896 "template argument must be a complete class or an unbounded array");
899 template<
typename _Tp,
typename... _Args>
900 struct __is_constructible_impl
905 template<
typename _Tp,
typename... _Args>
907 :
public __is_constructible_impl<_Tp, _Args...>
909 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
910 "template argument must be a complete class or an unbounded array");
914 template<
typename _Tp>
916 :
public __is_constructible_impl<_Tp>::type
918 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
919 "template argument must be a complete class or an unbounded array");
922 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
923 struct __is_copy_constructible_impl;
925 template<
typename _Tp>
926 struct __is_copy_constructible_impl<_Tp, false>
929 template<
typename _Tp>
930 struct __is_copy_constructible_impl<_Tp, true>
931 :
public __is_constructible_impl<_Tp, const _Tp&>
935 template<
typename _Tp>
937 :
public __is_copy_constructible_impl<_Tp>
939 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
940 "template argument must be a complete class or an unbounded array");
943 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
944 struct __is_move_constructible_impl;
946 template<
typename _Tp>
947 struct __is_move_constructible_impl<_Tp, false>
950 template<
typename _Tp>
951 struct __is_move_constructible_impl<_Tp, true>
952 :
public __is_constructible_impl<_Tp, _Tp&&>
956 template<
typename _Tp>
958 :
public __is_move_constructible_impl<_Tp>
960 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
961 "template argument must be a complete class or an unbounded array");
964 template<bool,
typename _Tp,
typename... _Args>
965 struct __is_nt_constructible_impl
969 template<
typename _Tp,
typename... _Args>
970 struct __is_nt_constructible_impl<true, _Tp, _Args...>
971 :
public __bool_constant<noexcept(_Tp(std::declval<_Args>()...))>
974 template<
typename _Tp,
typename _Arg>
975 struct __is_nt_constructible_impl<true, _Tp, _Arg>
976 :
public __bool_constant<noexcept(static_cast<_Tp>(std::declval<_Arg>()))>
979 template<
typename _Tp>
980 struct __is_nt_constructible_impl<true, _Tp>
981 :
public __bool_constant<noexcept(_Tp())>
984 template<
typename _Tp,
size_t _Num>
985 struct __is_nt_constructible_impl<true, _Tp[_Num]>
986 :
public __bool_constant<noexcept(typename remove_all_extents<_Tp>::type())>
989 template<
typename _Tp,
typename... _Args>
990 using __is_nothrow_constructible_impl
991 = __is_nt_constructible_impl<__is_constructible(_Tp, _Args...),
995 template<
typename _Tp,
typename... _Args>
997 :
public __is_nothrow_constructible_impl<_Tp, _Args...>::type
999 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1000 "template argument must be a complete class or an unbounded array");
1004 template<
typename _Tp>
1006 :
public __is_nothrow_constructible_impl<_Tp>::type
1008 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1009 "template argument must be a complete class or an unbounded array");
1013 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1014 struct __is_nothrow_copy_constructible_impl;
1016 template<
typename _Tp>
1017 struct __is_nothrow_copy_constructible_impl<_Tp, false>
1020 template<
typename _Tp>
1021 struct __is_nothrow_copy_constructible_impl<_Tp, true>
1022 :
public __is_nothrow_constructible_impl<_Tp, const _Tp&>
1026 template<
typename _Tp>
1028 :
public __is_nothrow_copy_constructible_impl<_Tp>::type
1030 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1031 "template argument must be a complete class or an unbounded array");
1034 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1035 struct __is_nothrow_move_constructible_impl;
1037 template<
typename _Tp>
1038 struct __is_nothrow_move_constructible_impl<_Tp, false>
1041 template<
typename _Tp>
1042 struct __is_nothrow_move_constructible_impl<_Tp, true>
1043 :
public __is_nothrow_constructible_impl<_Tp, _Tp&&>
1047 template<
typename _Tp>
1049 :
public __is_nothrow_move_constructible_impl<_Tp>::type
1051 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1052 "template argument must be a complete class or an unbounded array");
1056 template<
typename _Tp,
typename _Up>
1060 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1061 "template argument must be a complete class or an unbounded array");
1064 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1065 struct __is_copy_assignable_impl;
1067 template<
typename _Tp>
1068 struct __is_copy_assignable_impl<_Tp, false>
1071 template<
typename _Tp>
1072 struct __is_copy_assignable_impl<_Tp, true>
1073 :
public __bool_constant<__is_assignable(_Tp&, const _Tp&)>
1077 template<
typename _Tp>
1079 :
public __is_copy_assignable_impl<_Tp>::type
1081 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1082 "template argument must be a complete class or an unbounded array");
1085 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1086 struct __is_move_assignable_impl;
1088 template<
typename _Tp>
1089 struct __is_move_assignable_impl<_Tp, false>
1092 template<
typename _Tp>
1093 struct __is_move_assignable_impl<_Tp, true>
1094 :
public __bool_constant<__is_assignable(_Tp&, _Tp&&)>
1098 template<
typename _Tp>
1100 :
public __is_move_assignable_impl<_Tp>::type
1102 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1103 "template argument must be a complete class or an unbounded array");
1106 template<
typename _Tp,
typename _Up>
1107 struct __is_nt_assignable_impl
1111 template<
typename _Tp,
typename _Up>
1112 struct __is_nothrow_assignable_impl
1113 :
public __and_<__bool_constant<__is_assignable(_Tp, _Up)>,
1114 __is_nt_assignable_impl<_Tp, _Up>>
1118 template<
typename _Tp,
typename _Up>
1120 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1122 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1123 "template argument must be a complete class or an unbounded array");
1126 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1127 struct __is_nt_copy_assignable_impl;
1129 template<
typename _Tp>
1130 struct __is_nt_copy_assignable_impl<_Tp, false>
1133 template<
typename _Tp>
1134 struct __is_nt_copy_assignable_impl<_Tp, true>
1135 :
public __is_nothrow_assignable_impl<_Tp&, const _Tp&>
1139 template<
typename _Tp>
1141 :
public __is_nt_copy_assignable_impl<_Tp>
1143 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1144 "template argument must be a complete class or an unbounded array");
1147 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1148 struct __is_nt_move_assignable_impl;
1150 template<
typename _Tp>
1151 struct __is_nt_move_assignable_impl<_Tp, false>
1154 template<
typename _Tp>
1155 struct __is_nt_move_assignable_impl<_Tp, true>
1156 :
public __is_nothrow_assignable_impl<_Tp&, _Tp&&>
1160 template<
typename _Tp>
1162 :
public __is_nt_move_assignable_impl<_Tp>
1164 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1165 "template argument must be a complete class or an unbounded array");
1169 template<
typename _Tp,
typename... _Args>
1173 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1174 "template argument must be a complete class or an unbounded array");
1178 template<
typename _Tp>
1182 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1183 "template argument must be a complete class or an unbounded array");
1186 struct __do_is_implicitly_default_constructible_impl
1188 template <
typename _Tp>
1189 static void __helper(
const _Tp&);
1191 template <
typename _Tp>
1193 decltype(__helper<const _Tp&>({}))* = 0);
1198 template<
typename _Tp>
1199 struct __is_implicitly_default_constructible_impl
1200 :
public __do_is_implicitly_default_constructible_impl
1202 typedef decltype(__test(declval<_Tp>())) type;
1205 template<
typename _Tp>
1206 struct __is_implicitly_default_constructible_safe
1207 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1210 template <
typename _Tp>
1211 struct __is_implicitly_default_constructible
1212 :
public __and_<__is_constructible_impl<_Tp>,
1213 __is_implicitly_default_constructible_safe<_Tp>>
1216 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1217 struct __is_trivially_copy_constructible_impl;
1219 template<
typename _Tp>
1220 struct __is_trivially_copy_constructible_impl<_Tp, false>
1223 template<
typename _Tp>
1224 struct __is_trivially_copy_constructible_impl<_Tp, true>
1225 :
public __and_<__is_copy_constructible_impl<_Tp>,
1226 integral_constant<bool,
1227 __is_trivially_constructible(_Tp, const _Tp&)>>
1231 template<
typename _Tp>
1233 :
public __is_trivially_copy_constructible_impl<_Tp>
1235 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1236 "template argument must be a complete class or an unbounded array");
1239 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1240 struct __is_trivially_move_constructible_impl;
1242 template<
typename _Tp>
1243 struct __is_trivially_move_constructible_impl<_Tp, false>
1246 template<
typename _Tp>
1247 struct __is_trivially_move_constructible_impl<_Tp, true>
1248 :
public __and_<__is_move_constructible_impl<_Tp>,
1249 integral_constant<bool,
1250 __is_trivially_constructible(_Tp, _Tp&&)>>
1254 template<
typename _Tp>
1256 :
public __is_trivially_move_constructible_impl<_Tp>
1258 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1259 "template argument must be a complete class or an unbounded array");
1263 template<
typename _Tp,
typename _Up>
1267 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1268 "template argument must be a complete class or an unbounded array");
1271 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1272 struct __is_trivially_copy_assignable_impl;
1274 template<
typename _Tp>
1275 struct __is_trivially_copy_assignable_impl<_Tp, false>
1278 template<
typename _Tp>
1279 struct __is_trivially_copy_assignable_impl<_Tp, true>
1280 :
public __bool_constant<__is_trivially_assignable(_Tp&, const _Tp&)>
1284 template<
typename _Tp>
1286 :
public __is_trivially_copy_assignable_impl<_Tp>
1288 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1289 "template argument must be a complete class or an unbounded array");
1292 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1293 struct __is_trivially_move_assignable_impl;
1295 template<
typename _Tp>
1296 struct __is_trivially_move_assignable_impl<_Tp, false>
1299 template<
typename _Tp>
1300 struct __is_trivially_move_assignable_impl<_Tp, true>
1301 :
public __bool_constant<__is_trivially_assignable(_Tp&, _Tp&&)>
1305 template<
typename _Tp>
1307 :
public __is_trivially_move_assignable_impl<_Tp>
1309 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1310 "template argument must be a complete class or an unbounded array");
1314 template<
typename _Tp>
1316 :
public __and_<__is_destructible_safe<_Tp>,
1317 __bool_constant<__has_trivial_destructor(_Tp)>>
1319 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1320 "template argument must be a complete class or an unbounded array");
1325 template<
typename _Tp>
1329 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1330 "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");
1350 template<
typename _Tp, std::
size_t _Size>
1351 struct rank<_Tp[_Size]>
1354 template<
typename _Tp>
1356 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1359 template<
typename,
unsigned _U
int>
1363 template<
typename _Tp,
unsigned _U
int, std::
size_t _Size>
1364 struct extent<_Tp[_Size], _Uint>
1366 _Uint == 0 ? _Size : extent<_Tp,
1370 template<
typename _Tp,
unsigned _U
int>
1371 struct extent<_Tp[], _Uint>
1372 :
public integral_constant<std::size_t,
1373 _Uint == 0 ? 0 : extent<_Tp,
1381 template<
typename _Tp,
typename _Up>
1383#ifdef _GLIBCXX_BUILTIN_IS_SAME_AS
1390#ifndef _GLIBCXX_BUILTIN_IS_SAME_AS
1391 template<
typename _Tp>
1398 template<
typename _Base,
typename _Derived>
1403 template<
typename _From,
typename _To,
1406 struct __is_convertible_helper
1411#pragma GCC diagnostic push
1412#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1413 template<
typename _From,
typename _To>
1414 class __is_convertible_helper<_From, _To, false>
1416 template<
typename _To1>
1417 static void __test_aux(_To1)
noexcept;
1419 template<
typename _From1,
typename _To1,
1420 typename =
decltype(__test_aux<_To1>(std::declval<_From1>()))>
1424 template<
typename,
typename>
1429 typedef decltype(__test<_From, _To>(0)) type;
1431#pragma GCC diagnostic pop
1434 template<
typename _From,
typename _To>
1436 :
public __is_convertible_helper<_From, _To>::type
1440 template<
typename _ToElementType,
typename _FromElementType>
1444 template<
typename _From,
typename _To,
1447 struct __is_nt_convertible_helper
1451#pragma GCC diagnostic push
1452#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1453 template<
typename _From,
typename _To>
1454 class __is_nt_convertible_helper<_From, _To, false>
1456 template<
typename _To1>
1457 static void __test_aux(_To1)
noexcept;
1459 template<
typename _From1,
typename _To1>
1461 __bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))>
1464 template<
typename,
typename>
1469 using type =
decltype(__test<_From, _To>(0));
1471#pragma GCC diagnostic pop
1474 template<
typename _From,
typename _To>
1475 struct __is_nothrow_convertible
1476 :
public __is_nt_convertible_helper<_From, _To>::type
1479#if __cplusplus > 201703L
1481 template<
typename _From,
typename _To>
1482 struct is_nothrow_convertible
1483 :
public __is_nt_convertible_helper<_From, _To>::type
1487 template<
typename _From,
typename _To>
1488 inline constexpr bool is_nothrow_convertible_v
1489 = is_nothrow_convertible<_From, _To>::value;
1495 template<
typename _Tp>
1497 {
typedef _Tp type; };
1499 template<
typename _Tp>
1501 {
typedef _Tp type; };
1504 template<
typename _Tp>
1506 {
typedef _Tp type; };
1508 template<
typename _Tp>
1510 {
typedef _Tp type; };
1513 template<
typename _Tp>
1515 {
using type = _Tp; };
1517 template<
typename _Tp>
1519 {
using type = _Tp; };
1521 template<
typename _Tp>
1522 struct remove_cv<volatile _Tp>
1523 {
using type = _Tp; };
1525 template<
typename _Tp>
1526 struct remove_cv<const volatile _Tp>
1527 {
using type = _Tp; };
1530 template<
typename _Tp>
1532 {
typedef _Tp
const type; };
1535 template<
typename _Tp>
1537 {
typedef _Tp
volatile type; };
1540 template<
typename _Tp>
1547#if __cplusplus > 201103L
1549#define __cpp_lib_transformation_trait_aliases 201304
1552 template<
typename _Tp>
1556 template<
typename _Tp>
1560 template<
typename _Tp>
1564 template<
typename _Tp>
1568 template<
typename _Tp>
1572 template<
typename _Tp>
1579 template<
typename _Tp>
1581 {
typedef _Tp type; };
1583 template<
typename _Tp>
1585 {
typedef _Tp type; };
1587 template<
typename _Tp>
1588 struct remove_reference<_Tp&&>
1589 {
typedef _Tp type; };
1591 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1592 struct __add_lvalue_reference_helper
1593 {
typedef _Tp type; };
1595 template<
typename _Tp>
1596 struct __add_lvalue_reference_helper<_Tp, true>
1597 {
typedef _Tp& type; };
1600 template<
typename _Tp>
1602 :
public __add_lvalue_reference_helper<_Tp>
1605 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1606 struct __add_rvalue_reference_helper
1607 {
typedef _Tp type; };
1609 template<
typename _Tp>
1610 struct __add_rvalue_reference_helper<_Tp, true>
1611 {
typedef _Tp&& type; };
1614 template<
typename _Tp>
1616 :
public __add_rvalue_reference_helper<_Tp>
1619#if __cplusplus > 201103L
1621 template<
typename _Tp>
1625 template<
typename _Tp>
1629 template<
typename _Tp>
1636 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1637 struct __cv_selector;
1639 template<
typename _Unqualified>
1640 struct __cv_selector<_Unqualified, false, false>
1641 {
typedef _Unqualified __type; };
1643 template<
typename _Unqualified>
1644 struct __cv_selector<_Unqualified, false, true>
1645 {
typedef volatile _Unqualified __type; };
1647 template<
typename _Unqualified>
1648 struct __cv_selector<_Unqualified, true, false>
1649 {
typedef const _Unqualified __type; };
1651 template<
typename _Unqualified>
1652 struct __cv_selector<_Unqualified, true, true>
1653 {
typedef const volatile _Unqualified __type; };
1655 template<
typename _Qualified,
typename _Unqualified,
1656 bool _IsConst = is_const<_Qualified>::value,
1657 bool _IsVol = is_volatile<_Qualified>::value>
1658 class __match_cv_qualifiers
1660 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1663 typedef typename __match::__type __type;
1667 template<
typename _Tp>
1668 struct __make_unsigned
1669 {
typedef _Tp __type; };
1672 struct __make_unsigned<char>
1673 {
typedef unsigned char __type; };
1676 struct __make_unsigned<signed char>
1677 {
typedef unsigned char __type; };
1680 struct __make_unsigned<short>
1681 {
typedef unsigned short __type; };
1684 struct __make_unsigned<int>
1685 {
typedef unsigned int __type; };
1688 struct __make_unsigned<long>
1689 {
typedef unsigned long __type; };
1692 struct __make_unsigned<long long>
1693 {
typedef unsigned long long __type; };
1695#if defined(__GLIBCXX_TYPE_INT_N_0)
1697 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1698 {
typedef unsigned __GLIBCXX_TYPE_INT_N_0 __type; };
1700#if defined(__GLIBCXX_TYPE_INT_N_1)
1702 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1703 {
typedef unsigned __GLIBCXX_TYPE_INT_N_1 __type; };
1705#if defined(__GLIBCXX_TYPE_INT_N_2)
1707 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1708 {
typedef unsigned __GLIBCXX_TYPE_INT_N_2 __type; };
1710#if defined(__GLIBCXX_TYPE_INT_N_3)
1712 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1713 {
typedef unsigned __GLIBCXX_TYPE_INT_N_3 __type; };
1717 template<
typename _Tp,
1718 bool _IsInt = is_integral<_Tp>::value,
1719 bool _IsEnum = is_enum<_Tp>::value>
1720 class __make_unsigned_selector;
1722 template<
typename _Tp>
1723 class __make_unsigned_selector<_Tp, true, false>
1725 using __unsigned_type
1726 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
1730 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1733 class __make_unsigned_selector_base
1736 template<
typename...>
struct _List { };
1738 template<
typename _Tp,
typename... _Up>
1739 struct _List<_Tp, _Up...> : _List<_Up...>
1740 {
static constexpr size_t __size =
sizeof(_Tp); };
1742 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
1745 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
1746 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
1747 {
using __type = _Uint; };
1749 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
1750 struct __select<_Sz, _List<_Uint, _UInts...>, false>
1751 : __select<_Sz, _List<_UInts...>>
1756 template<
typename _Tp>
1757 class __make_unsigned_selector<_Tp, false, true>
1758 : __make_unsigned_selector_base
1761 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
1762 unsigned long,
unsigned long long>;
1764 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
1768 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1775#if defined(_GLIBCXX_USE_WCHAR_T)
1777 struct __make_unsigned<wchar_t>
1780 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
1784#ifdef _GLIBCXX_USE_CHAR8_T
1786 struct __make_unsigned<char8_t>
1789 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
1794 struct __make_unsigned<char16_t>
1797 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
1801 struct __make_unsigned<char32_t>
1804 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
1811 template<
typename _Tp>
1813 {
typedef typename __make_unsigned_selector<_Tp>::__type type; };
1821 template<
typename _Tp>
1822 struct __make_signed
1823 {
typedef _Tp __type; };
1826 struct __make_signed<char>
1827 {
typedef signed char __type; };
1830 struct __make_signed<unsigned char>
1831 {
typedef signed char __type; };
1834 struct __make_signed<unsigned short>
1835 {
typedef signed short __type; };
1838 struct __make_signed<unsigned int>
1839 {
typedef signed int __type; };
1842 struct __make_signed<unsigned long>
1843 {
typedef signed long __type; };
1846 struct __make_signed<unsigned long long>
1847 {
typedef signed long long __type; };
1849#if defined(__GLIBCXX_TYPE_INT_N_0)
1851 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
1852 {
typedef __GLIBCXX_TYPE_INT_N_0 __type; };
1854#if defined(__GLIBCXX_TYPE_INT_N_1)
1856 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
1857 {
typedef __GLIBCXX_TYPE_INT_N_1 __type; };
1859#if defined(__GLIBCXX_TYPE_INT_N_2)
1861 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
1862 {
typedef __GLIBCXX_TYPE_INT_N_2 __type; };
1864#if defined(__GLIBCXX_TYPE_INT_N_3)
1866 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
1867 {
typedef __GLIBCXX_TYPE_INT_N_3 __type; };
1871 template<
typename _Tp,
1872 bool _IsInt = is_integral<_Tp>::value,
1873 bool _IsEnum = is_enum<_Tp>::value>
1874 class __make_signed_selector;
1876 template<
typename _Tp>
1877 class __make_signed_selector<_Tp, true, false>
1880 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
1884 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
1888 template<
typename _Tp>
1889 class __make_signed_selector<_Tp, false, true>
1891 typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
1894 typedef typename __make_signed_selector<__unsigned_type>::__type __type;
1901#if defined(_GLIBCXX_USE_WCHAR_T)
1903 struct __make_signed<wchar_t>
1906 =
typename __make_signed_selector<wchar_t, false, true>::__type;
1910#if defined(_GLIBCXX_USE_CHAR8_T)
1912 struct __make_signed<char8_t>
1915 =
typename __make_signed_selector<char8_t, false, true>::__type;
1920 struct __make_signed<char16_t>
1923 =
typename __make_signed_selector<char16_t, false, true>::__type;
1927 struct __make_signed<char32_t>
1930 =
typename __make_signed_selector<char32_t, false, true>::__type;
1937 template<
typename _Tp>
1939 {
typedef typename __make_signed_selector<_Tp>::__type type; };
1945#if __cplusplus > 201103L
1947 template<
typename _Tp>
1951 template<
typename _Tp>
1958 template<
typename _Tp>
1960 {
typedef _Tp type; };
1962 template<
typename _Tp, std::
size_t _Size>
1964 {
typedef _Tp type; };
1966 template<
typename _Tp>
1967 struct remove_extent<_Tp[]>
1968 {
typedef _Tp type; };
1971 template<
typename _Tp>
1973 {
typedef _Tp type; };
1975 template<
typename _Tp, std::
size_t _Size>
1977 {
typedef typename remove_all_extents<_Tp>::type type; };
1979 template<
typename _Tp>
1980 struct remove_all_extents<_Tp[]>
1981 {
typedef typename remove_all_extents<_Tp>::type type; };
1983#if __cplusplus > 201103L
1985 template<
typename _Tp>
1989 template<
typename _Tp>
1995 template<
typename _Tp,
typename>
1996 struct __remove_pointer_helper
1997 {
typedef _Tp type; };
1999 template<
typename _Tp,
typename _Up>
2000 struct __remove_pointer_helper<_Tp, _Up*>
2001 {
typedef _Up type; };
2004 template<
typename _Tp>
2006 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2010 template<
typename _Tp,
bool = __or_<__is_referenceable<_Tp>,
2011 is_
void<_Tp>>::value>
2013 {
typedef _Tp type; };
2015 template<
typename _Tp>
2017 {
typedef typename remove_reference<_Tp>::type* type; };
2019 template<
typename _Tp>
2021 :
public __add_pointer_helper<_Tp>
2024#if __cplusplus > 201103L
2026 template<
typename _Tp>
2030 template<
typename _Tp>
2034 template<std::
size_t _Len>
2035 struct __aligned_storage_msa
2039 unsigned char __data[_Len];
2040 struct __attribute__((__aligned__)) { } __align;
2054 template<std::size_t _Len, std::size_t _Align =
2055 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2060 unsigned char __data[_Len];
2061 struct __attribute__((__aligned__((_Align)))) { } __align;
2065 template <
typename... _Types>
2066 struct __strictest_alignment
2068 static const size_t _S_alignment = 0;
2069 static const size_t _S_size = 0;
2072 template <
typename _Tp,
typename... _Types>
2073 struct __strictest_alignment<_Tp, _Types...>
2075 static const size_t _S_alignment =
2076 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2077 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2078 static const size_t _S_size =
2079 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2080 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2093 template <
size_t _Len,
typename... _Types>
2097 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2099 using __strictest = __strictest_alignment<_Types...>;
2100 static const size_t _S_len = _Len > __strictest::_S_size
2101 ? _Len : __strictest::_S_size;
2109 template <
size_t _Len,
typename... _Types>
2110 const size_t aligned_union<_Len, _Types...>::alignment_value;
2114 template<
typename _Up,
2117 struct __decay_selector;
2120 template<
typename _Up>
2121 struct __decay_selector<_Up, false, false>
2122 {
typedef __remove_cv_t<_Up> __type; };
2124 template<
typename _Up>
2125 struct __decay_selector<_Up, true, false>
2126 {
typedef typename remove_extent<_Up>::type* __type; };
2128 template<
typename _Up>
2129 struct __decay_selector<_Up, false, true>
2130 {
typedef typename add_pointer<_Up>::type __type; };
2133 template<
typename _Tp>
2136 typedef typename remove_reference<_Tp>::type __remove_type;
2139 typedef typename __decay_selector<__remove_type>::__type type;
2143 template<
typename _Tp>
2144 using __decay_t =
typename decay<_Tp>::type;
2146 template<
typename _Tp>
2150 template<
typename _Tp>
2151 struct __strip_reference_wrapper
2156 template<
typename _Tp>
2157 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
2159 typedef _Tp& __type;
2162 template<
typename _Tp>
2163 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2168 template<
bool,
typename _Tp =
void>
2173 template<
typename _Tp>
2175 {
typedef _Tp type; };
2178 template<
bool _Cond,
typename _Tp =
void>
2179 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
2181 template<
typename... _Cond>
2182 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2186 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2188 {
typedef _Iftrue type; };
2191 template<
typename _Iftrue,
typename _Iffalse>
2193 {
typedef _Iffalse type; };
2196 template<
typename _Tp>
2197 using __remove_cvref_t
2198 =
typename remove_cv<typename remove_reference<_Tp>::type>::type;
2201 template<
typename... _Tp>
2206 struct __do_common_type_impl
2208 template<
typename _Tp,
typename _Up>
2210 =
decltype(
true ? std::declval<_Tp>() :
std::declval<_Up>());
2214 template<
typename _Tp,
typename _Up>
2215 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2218#if __cplusplus > 201703L
2221 template<
typename _Tp,
typename _Up>
2222 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2226 template<
typename,
typename>
2227 static __failure_type
2230 template<
typename _Tp,
typename _Up>
2231 static decltype(_S_test_2<_Tp, _Up>(0))
2241 template<
typename _Tp0>
2242 struct common_type<_Tp0>
2243 :
public common_type<_Tp0, _Tp0>
2247 template<
typename _Tp1,
typename _Tp2,
2248 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2249 struct __common_type_impl
2253 using type = common_type<_Dp1, _Dp2>;
2256 template<
typename _Tp1,
typename _Tp2>
2257 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2258 :
private __do_common_type_impl
2262 using type =
decltype(_S_test<_Tp1, _Tp2>(0));
2266 template<
typename _Tp1,
typename _Tp2>
2267 struct common_type<_Tp1, _Tp2>
2268 :
public __common_type_impl<_Tp1, _Tp2>::type
2271 template<
typename...>
2272 struct __common_type_pack
2275 template<
typename,
typename,
typename =
void>
2276 struct __common_type_fold;
2279 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2280 struct common_type<_Tp1, _Tp2, _Rp...>
2281 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2282 __common_type_pack<_Rp...>>
2288 template<
typename _CTp,
typename... _Rp>
2289 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2290 __void_t<typename _CTp::type>>
2291 :
public common_type<typename _CTp::type, _Rp...>
2295 template<
typename _CTp,
typename _Rp>
2296 struct __common_type_fold<_CTp, _Rp, void>
2299 template<typename _Tp, bool = is_enum<_Tp>::value>
2300 struct __underlying_type_impl
2302 using type = __underlying_type(_Tp);
2305 template<
typename _Tp>
2306 struct __underlying_type_impl<_Tp, false>
2310 template<
typename _Tp>
2312 :
public __underlying_type_impl<_Tp>
2315 template<
typename _Tp>
2316 struct __declval_protector
2318 static const bool __stop =
false;
2321 template<
typename _Tp>
2322 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2324 static_assert(__declval_protector<_Tp>::__stop,
2325 "declval() must not be used!");
2326 return __declval<_Tp>(0);
2330 template<
typename _Signature>
2335#define __cpp_lib_result_of_sfinae 201210
2337 struct __invoke_memfun_ref { };
2338 struct __invoke_memfun_deref { };
2339 struct __invoke_memobj_ref { };
2340 struct __invoke_memobj_deref { };
2341 struct __invoke_other { };
2344 template<
typename _Tp,
typename _Tag>
2345 struct __result_of_success : __success_type<_Tp>
2346 {
using __invoke_type = _Tag; };
2349 struct __result_of_memfun_ref_impl
2351 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2352 static __result_of_success<
decltype(
2353 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2354 ), __invoke_memfun_ref> _S_test(
int);
2356 template<
typename...>
2357 static __failure_type _S_test(...);
2360 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2361 struct __result_of_memfun_ref
2362 :
private __result_of_memfun_ref_impl
2364 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2368 struct __result_of_memfun_deref_impl
2370 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2371 static __result_of_success<
decltype(
2372 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2373 ), __invoke_memfun_deref> _S_test(
int);
2375 template<
typename...>
2376 static __failure_type _S_test(...);
2379 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2380 struct __result_of_memfun_deref
2381 :
private __result_of_memfun_deref_impl
2383 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2387 struct __result_of_memobj_ref_impl
2389 template<
typename _Fp,
typename _Tp1>
2390 static __result_of_success<
decltype(
2391 std::declval<_Tp1>().*std::declval<_Fp>()
2392 ), __invoke_memobj_ref> _S_test(
int);
2394 template<
typename,
typename>
2395 static __failure_type _S_test(...);
2398 template<
typename _MemPtr,
typename _Arg>
2399 struct __result_of_memobj_ref
2400 :
private __result_of_memobj_ref_impl
2402 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2406 struct __result_of_memobj_deref_impl
2408 template<
typename _Fp,
typename _Tp1>
2409 static __result_of_success<
decltype(
2410 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2411 ), __invoke_memobj_deref> _S_test(
int);
2413 template<
typename,
typename>
2414 static __failure_type _S_test(...);
2417 template<
typename _MemPtr,
typename _Arg>
2418 struct __result_of_memobj_deref
2419 :
private __result_of_memobj_deref_impl
2421 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2424 template<
typename _MemPtr,
typename _Arg>
2425 struct __result_of_memobj;
2427 template<
typename _Res,
typename _Class,
typename _Arg>
2428 struct __result_of_memobj<_Res _Class::*, _Arg>
2430 typedef __remove_cvref_t<_Arg> _Argval;
2431 typedef _Res _Class::* _MemPtr;
2432 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2433 is_base_of<_Class, _Argval>>::value,
2434 __result_of_memobj_ref<_MemPtr, _Arg>,
2435 __result_of_memobj_deref<_MemPtr, _Arg>
2439 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2440 struct __result_of_memfun;
2442 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2443 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2445 typedef typename remove_reference<_Arg>::type _Argval;
2446 typedef _Res _Class::* _MemPtr;
2447 typedef typename conditional<is_base_of<_Class, _Argval>::value,
2448 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2449 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2458 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2464 template<
typename _Tp,
typename _Up>
2465 struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
2470 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2471 struct __result_of_impl
2473 typedef __failure_type type;
2476 template<
typename _MemPtr,
typename _Arg>
2477 struct __result_of_impl<true, false, _MemPtr, _Arg>
2478 :
public __result_of_memobj<__decay_t<_MemPtr>,
2479 typename __inv_unwrap<_Arg>::type>
2482 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2483 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2484 :
public __result_of_memfun<__decay_t<_MemPtr>,
2485 typename __inv_unwrap<_Arg>::type, _Args...>
2489 struct __result_of_other_impl
2491 template<
typename _Fn,
typename... _Args>
2492 static __result_of_success<
decltype(
2493 std::declval<_Fn>()(std::declval<_Args>()...)
2494 ), __invoke_other> _S_test(
int);
2496 template<
typename...>
2497 static __failure_type _S_test(...);
2500 template<
typename _Functor,
typename... _ArgTypes>
2501 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2502 :
private __result_of_other_impl
2504 typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2508 template<typename _Functor, typename... _ArgTypes>
2509 struct __invoke_result
2510 : public __result_of_impl<
2511 is_member_object_pointer<
2512 typename remove_reference<_Functor>::type
2514 is_member_function_pointer<
2515 typename remove_reference<_Functor>::type
2517 _Functor, _ArgTypes...
2521 template<
typename _Functor,
typename... _ArgTypes>
2522 struct result_of<_Functor(_ArgTypes...)>
2523 :
public __invoke_result<_Functor, _ArgTypes...>
2526#if __cplusplus >= 201402L
2528 template<
size_t _Len,
size_t _Align =
2529 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2532 template <
size_t _Len,
typename... _Types>
2533 using aligned_union_t =
typename aligned_union<_Len, _Types...>::type;
2536 template<
typename _Tp>
2540 template<
bool _Cond,
typename _Tp =
void>
2544 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2548 template<
typename... _Tp>
2552 template<
typename _Tp>
2556 template<
typename _Tp>
2560#if __cplusplus >= 201703L || !defined(__STRICT_ANSI__)
2561#define __cpp_lib_void_t 201411
2567 template<
typename _Default,
typename _AlwaysVoid,
2568 template<
typename...>
class _Op,
typename... _Args>
2572 using type = _Default;
2576 template<
typename _Default,
template<
typename...>
class _Op,
2578 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2581 using type = _Op<_Args...>;
2585 template<
typename _Default,
template<
typename...>
class _Op,
2590 template<
typename _Default,
template<
typename...>
class _Op,
2592 using __detected_or_t
2601#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2602 template<typename _Tp, typename = __void_t<>> \
2603 struct __has_##_NTYPE \
2606 template<typename _Tp> \
2607 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
2611 template <
typename _Tp>
2612 struct __is_swappable;
2614 template <
typename _Tp>
2615 struct __is_nothrow_swappable;
2617 template<
typename... _Elements>
2624 template<
typename... _Tps>
2625 struct __is_tuple_like_impl<tuple<_Tps...>> :
true_type
2629 template<
typename _Tp>
2630 struct __is_tuple_like
2631 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
2634 template<
typename _Tp>
2635 _GLIBCXX20_CONSTEXPR
2637 _Require<__not_<__is_tuple_like<_Tp>>,
2638 is_move_constructible<_Tp>,
2639 is_move_assignable<_Tp>>
2641 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2642 is_nothrow_move_assignable<_Tp>>::value);
2644 template<
typename _Tp,
size_t _Nm>
2645 _GLIBCXX20_CONSTEXPR
2647 __enable_if_t<__is_swappable<_Tp>::value>
2648 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2649 noexcept(__is_nothrow_swappable<_Tp>::value);
2651 namespace __swappable_details {
2654 struct __do_is_swappable_impl
2656 template<
typename _Tp,
typename
2657 =
decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2664 struct __do_is_nothrow_swappable_impl
2666 template<
typename _Tp>
2667 static __bool_constant<
2668 noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2677 template<
typename _Tp>
2678 struct __is_swappable_impl
2679 :
public __swappable_details::__do_is_swappable_impl
2681 typedef decltype(__test<_Tp>(0)) type;
2684 template<
typename _Tp>
2685 struct __is_nothrow_swappable_impl
2686 :
public __swappable_details::__do_is_nothrow_swappable_impl
2688 typedef decltype(__test<_Tp>(0)) type;
2691 template<
typename _Tp>
2692 struct __is_swappable
2693 :
public __is_swappable_impl<_Tp>::type
2696 template<
typename _Tp>
2697 struct __is_nothrow_swappable
2698 :
public __is_nothrow_swappable_impl<_Tp>::type
2701#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
2702#define __cpp_lib_is_swappable 201603
2706 template<
typename _Tp>
2708 :
public __is_swappable_impl<_Tp>::type
2710 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2711 "template argument must be a complete class or an unbounded array");
2715 template<
typename _Tp>
2717 :
public __is_nothrow_swappable_impl<_Tp>::type
2719 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2720 "template argument must be a complete class or an unbounded array");
2723#if __cplusplus >= 201402L
2725 template<
typename _Tp>
2730 template<
typename _Tp>
2735 namespace __swappable_with_details {
2738 struct __do_is_swappable_with_impl
2740 template<
typename _Tp,
typename _Up,
typename
2741 =
decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
2743 =
decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
2746 template<
typename,
typename>
2750 struct __do_is_nothrow_swappable_with_impl
2752 template<
typename _Tp,
typename _Up>
2754 noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
2756 noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
2759 template<
typename,
typename>
2765 template<
typename _Tp,
typename _Up>
2766 struct __is_swappable_with_impl
2767 :
public __swappable_with_details::__do_is_swappable_with_impl
2769 typedef decltype(__test<_Tp, _Up>(0)) type;
2773 template<
typename _Tp>
2774 struct __is_swappable_with_impl<_Tp&, _Tp&>
2775 :
public __swappable_details::__do_is_swappable_impl
2777 typedef decltype(__test<_Tp&>(0)) type;
2780 template<
typename _Tp,
typename _Up>
2781 struct __is_nothrow_swappable_with_impl
2782 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
2784 typedef decltype(__test<_Tp, _Up>(0)) type;
2788 template<
typename _Tp>
2789 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
2790 :
public __swappable_details::__do_is_nothrow_swappable_impl
2792 typedef decltype(__test<_Tp&>(0)) type;
2796 template<
typename _Tp,
typename _Up>
2798 :
public __is_swappable_with_impl<_Tp, _Up>::type
2802 template<
typename _Tp,
typename _Up>
2804 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
2807#if __cplusplus >= 201402L
2809 template<
typename _Tp,
typename _Up>
2814 template<
typename _Tp,
typename _Up>
2824 template<
typename _Result,
typename _Ret,
2829 template<
typename _Result,
typename _Ret>
2830 struct __is_invocable_impl<_Result, _Ret,
2832 __void_t<typename _Result::type>>
2836#pragma GCC diagnostic push
2837#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2839 template<
typename _Result,
typename _Ret>
2840 struct __is_invocable_impl<_Result, _Ret,
2842 __void_t<typename _Result::type>>
2847 static typename _Result::type _S_get();
2849 template<
typename _Tp>
2850 static void _S_conv(_Tp);
2853 template<typename _Tp, typename = decltype(_S_conv<_Tp>(_S_get()))>
2857 template<
typename _Tp>
2862 using type =
decltype(_S_test<_Ret>(1));
2864#pragma GCC diagnostic pop
2866 template<
typename _Fn,
typename... _ArgTypes>
2867 struct __is_invocable
2868 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2871 template<
typename _Fn,
typename _Tp,
typename... _Args>
2872 constexpr bool __call_is_nt(__invoke_memfun_ref)
2874 using _Up =
typename __inv_unwrap<_Tp>::type;
2875 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
2876 std::declval<_Args>()...));
2879 template<
typename _Fn,
typename _Tp,
typename... _Args>
2880 constexpr bool __call_is_nt(__invoke_memfun_deref)
2882 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
2883 std::declval<_Args>()...));
2886 template<
typename _Fn,
typename _Tp>
2887 constexpr bool __call_is_nt(__invoke_memobj_ref)
2889 using _Up =
typename __inv_unwrap<_Tp>::type;
2890 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
2893 template<
typename _Fn,
typename _Tp>
2894 constexpr bool __call_is_nt(__invoke_memobj_deref)
2896 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
2899 template<
typename _Fn,
typename... _Args>
2900 constexpr bool __call_is_nt(__invoke_other)
2902 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
2905 template<
typename _Result,
typename _Fn,
typename... _Args>
2906 struct __call_is_nothrow
2908 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
2912 template<
typename _Fn,
typename... _Args>
2913 using __call_is_nothrow_
2914 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
2917 template<
typename _Fn,
typename... _Args>
2918 struct __is_nothrow_invocable
2919 : __and_<__is_invocable<_Fn, _Args...>,
2920 __call_is_nothrow_<_Fn, _Args...>>::type
2923#pragma GCC diagnostic push
2924#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2925 struct __nonesuchbase {};
2926 struct __nonesuch :
private __nonesuchbase {
2927 ~__nonesuch() =
delete;
2928 __nonesuch(__nonesuch
const&) =
delete;
2929 void operator=(__nonesuch
const&) =
delete;
2931#pragma GCC diagnostic pop
2933#if __cplusplus >= 201703L
2934# define __cpp_lib_is_invocable 201703
2937 template<
typename _Functor,
typename... _ArgTypes>
2938 struct invoke_result
2939 :
public __invoke_result<_Functor, _ArgTypes...>
2943 template<
typename _Fn,
typename... _Args>
2944 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
2947 template<
typename _Fn,
typename... _ArgTypes>
2949 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2951 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2952 "_Fn must be a complete class or an unbounded array");
2956 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2957 struct is_invocable_r
2958 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
2960 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2961 "_Fn must be a complete class or an unbounded array");
2965 template<
typename _Fn,
typename... _ArgTypes>
2966 struct is_nothrow_invocable
2967 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
2968 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2970 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
2971 "_Fn must be a complete class or an unbounded array");
2974 template<
typename _Result,
typename _Ret,
typename =
void>
2975 struct __is_nt_invocable_impl :
false_type { };
2977 template<
typename _Result,
typename _Ret>
2978 struct __is_nt_invocable_impl<_Result, _Ret,
2979 __void_t<typename _Result::type>>
2980 : __or_<is_void<_Ret>,
2981 __is_nothrow_convertible<typename _Result::type, _Ret>>
2985 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2986 struct is_nothrow_invocable_r
2987 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
2988 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2992 template<
typename _Fn,
typename... _Args>
2993 inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
2996 template<
typename _Fn,
typename... _Args>
2997 inline constexpr bool is_nothrow_invocable_v
2998 = is_nothrow_invocable<_Fn, _Args...>::value;
3001 template<
typename _Ret,
typename _Fn,
typename... _Args>
3002 inline constexpr bool is_invocable_r_v
3003 = is_invocable_r<_Ret, _Fn, _Args...>::value;
3006 template<
typename _Ret,
typename _Fn,
typename... _Args>
3007 inline constexpr bool is_nothrow_invocable_r_v
3008 = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3011#if __cplusplus >= 201703L
3012# define __cpp_lib_type_trait_variable_templates 201510L
3013template <
typename _Tp>
3014 inline constexpr bool is_void_v = is_void<_Tp>::value;
3015template <
typename _Tp>
3016 inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
3017template <
typename _Tp>
3018 inline constexpr bool is_integral_v = is_integral<_Tp>::value;
3019template <
typename _Tp>
3020 inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value;
3021template <
typename _Tp>
3022 inline constexpr bool is_array_v = is_array<_Tp>::value;
3023template <
typename _Tp>
3024 inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
3025template <
typename _Tp>
3026 inline constexpr bool is_lvalue_reference_v =
3027 is_lvalue_reference<_Tp>::value;
3028template <
typename _Tp>
3029 inline constexpr bool is_rvalue_reference_v =
3030 is_rvalue_reference<_Tp>::value;
3031template <
typename _Tp>
3032 inline constexpr bool is_member_object_pointer_v =
3033 is_member_object_pointer<_Tp>::value;
3034template <
typename _Tp>
3035 inline constexpr bool is_member_function_pointer_v =
3036 is_member_function_pointer<_Tp>::value;
3037template <
typename _Tp>
3038 inline constexpr bool is_enum_v = is_enum<_Tp>::value;
3039template <
typename _Tp>
3040 inline constexpr bool is_union_v = is_union<_Tp>::value;
3041template <
typename _Tp>
3042 inline constexpr bool is_class_v = is_class<_Tp>::value;
3043template <
typename _Tp>
3044 inline constexpr bool is_function_v = is_function<_Tp>::value;
3045template <
typename _Tp>
3046 inline constexpr bool is_reference_v = is_reference<_Tp>::value;
3047template <
typename _Tp>
3048 inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value;
3049template <
typename _Tp>
3050 inline constexpr bool is_fundamental_v = is_fundamental<_Tp>::value;
3051template <
typename _Tp>
3052 inline constexpr bool is_object_v = is_object<_Tp>::value;
3053template <
typename _Tp>
3054 inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
3055template <
typename _Tp>
3056 inline constexpr bool is_compound_v = is_compound<_Tp>::value;
3057template <
typename _Tp>
3058 inline constexpr bool is_member_pointer_v = is_member_pointer<_Tp>::value;
3059template <
typename _Tp>
3060 inline constexpr bool is_const_v = is_const<_Tp>::value;
3061template <
typename _Tp>
3062 inline constexpr bool is_volatile_v = is_volatile<_Tp>::value;
3063template <
typename _Tp>
3064 inline constexpr bool is_trivial_v = is_trivial<_Tp>::value;
3065template <
typename _Tp>
3066 inline constexpr bool is_trivially_copyable_v =
3067 is_trivially_copyable<_Tp>::value;
3068template <
typename _Tp>
3069 inline constexpr bool is_standard_layout_v = is_standard_layout<_Tp>::value;
3070#pragma GCC diagnostic push
3071#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
3072template <
typename _Tp>
3073 _GLIBCXX20_DEPRECATED(
"use is_standard_layout_v && is_trivial_v instead")
3074 inline constexpr
bool is_pod_v = is_pod<_Tp>::value;
3075#pragma GCC diagnostic pop
3076template <
typename _Tp>
3077 inline constexpr bool is_literal_type_v = is_literal_type<_Tp>::value;
3078template <
typename _Tp>
3079 inline constexpr bool is_empty_v = is_empty<_Tp>::value;
3080template <
typename _Tp>
3081 inline constexpr bool is_polymorphic_v = is_polymorphic<_Tp>::value;
3082template <
typename _Tp>
3083 inline constexpr bool is_abstract_v = is_abstract<_Tp>::value;
3084template <
typename _Tp>
3085 inline constexpr bool is_final_v = is_final<_Tp>::value;
3086template <
typename _Tp>
3087 inline constexpr bool is_signed_v = is_signed<_Tp>::value;
3088template <
typename _Tp>
3089 inline constexpr bool is_unsigned_v = is_unsigned<_Tp>::value;
3090template <
typename _Tp,
typename... _Args>
3091 inline constexpr bool is_constructible_v =
3092 is_constructible<_Tp, _Args...>::value;
3093template <
typename _Tp>
3094 inline constexpr bool is_default_constructible_v =
3095 is_default_constructible<_Tp>::value;
3096template <
typename _Tp>
3097 inline constexpr bool is_copy_constructible_v =
3098 is_copy_constructible<_Tp>::value;
3099template <
typename _Tp>
3100 inline constexpr bool is_move_constructible_v =
3101 is_move_constructible<_Tp>::value;
3102template <
typename _Tp,
typename _Up>
3103 inline constexpr bool is_assignable_v = is_assignable<_Tp, _Up>::value;
3104template <
typename _Tp>
3105 inline constexpr bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
3106template <
typename _Tp>
3107 inline constexpr bool is_move_assignable_v = is_move_assignable<_Tp>::value;
3108template <
typename _Tp>
3109 inline constexpr bool is_destructible_v = is_destructible<_Tp>::value;
3110template <
typename _Tp,
typename... _Args>
3111 inline constexpr bool is_trivially_constructible_v =
3112 is_trivially_constructible<_Tp, _Args...>::value;
3113template <
typename _Tp>
3114 inline constexpr bool is_trivially_default_constructible_v =
3115 is_trivially_default_constructible<_Tp>::value;
3116template <
typename _Tp>
3117 inline constexpr bool is_trivially_copy_constructible_v =
3118 is_trivially_copy_constructible<_Tp>::value;
3119template <
typename _Tp>
3120 inline constexpr bool is_trivially_move_constructible_v =
3121 is_trivially_move_constructible<_Tp>::value;
3122template <
typename _Tp,
typename _Up>
3123 inline constexpr bool is_trivially_assignable_v =
3124 is_trivially_assignable<_Tp, _Up>::value;
3125template <
typename _Tp>
3126 inline constexpr bool is_trivially_copy_assignable_v =
3127 is_trivially_copy_assignable<_Tp>::value;
3128template <
typename _Tp>
3129 inline constexpr bool is_trivially_move_assignable_v =
3130 is_trivially_move_assignable<_Tp>::value;
3131template <
typename _Tp>
3132 inline constexpr bool is_trivially_destructible_v =
3133 is_trivially_destructible<_Tp>::value;
3134template <
typename _Tp,
typename... _Args>
3135 inline constexpr bool is_nothrow_constructible_v =
3136 is_nothrow_constructible<_Tp, _Args...>::value;
3137template <
typename _Tp>
3138 inline constexpr bool is_nothrow_default_constructible_v =
3139 is_nothrow_default_constructible<_Tp>::value;
3140template <
typename _Tp>
3141 inline constexpr bool is_nothrow_copy_constructible_v =
3142 is_nothrow_copy_constructible<_Tp>::value;
3143template <
typename _Tp>
3144 inline constexpr bool is_nothrow_move_constructible_v =
3145 is_nothrow_move_constructible<_Tp>::value;
3146template <
typename _Tp,
typename _Up>
3147 inline constexpr bool is_nothrow_assignable_v =
3148 is_nothrow_assignable<_Tp, _Up>::value;
3149template <
typename _Tp>
3150 inline constexpr bool is_nothrow_copy_assignable_v =
3151 is_nothrow_copy_assignable<_Tp>::value;
3152template <
typename _Tp>
3153 inline constexpr bool is_nothrow_move_assignable_v =
3154 is_nothrow_move_assignable<_Tp>::value;
3155template <
typename _Tp>
3156 inline constexpr bool is_nothrow_destructible_v =
3157 is_nothrow_destructible<_Tp>::value;
3158template <
typename _Tp>
3159 inline constexpr bool has_virtual_destructor_v =
3160 has_virtual_destructor<_Tp>::value;
3161template <
typename _Tp>
3162 inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
3163template <
typename _Tp>
3164 inline constexpr size_t rank_v = rank<_Tp>::value;
3165template <
typename _Tp,
unsigned _Idx = 0>
3166 inline constexpr size_t extent_v = extent<_Tp, _Idx>::value;
3167#ifdef _GLIBCXX_BUILTIN_IS_SAME_AS
3168template <
typename _Tp,
typename _Up>
3169 inline constexpr bool is_same_v = _GLIBCXX_BUILTIN_IS_SAME_AS(_Tp, _Up);
3171template <
typename _Tp,
typename _Up>
3174template <
typename _Base,
typename _Derived>
3175 inline constexpr bool is_base_of_v = is_base_of<_Base, _Derived>::value;
3176template <
typename _From,
typename _To>
3177 inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
3179#ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
3180# define __cpp_lib_has_unique_object_representations 201606
3182 template<
typename _Tp>
3183 struct has_unique_object_representations
3184 : bool_constant<__has_unique_object_representations(
3185 remove_cv_t<remove_all_extents_t<_Tp>>
3188 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3189 "template argument must be a complete class or an unbounded array");
3192 template<
typename _Tp>
3193 inline constexpr bool has_unique_object_representations_v
3194 = has_unique_object_representations<_Tp>::value;
3197#ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
3198# define __cpp_lib_is_aggregate 201703
3200 template<
typename _Tp>
3202 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3206 template<
typename _Tp>
3207 inline constexpr bool is_aggregate_v = is_aggregate<_Tp>::value;
3211#if __cplusplus > 201703L
3213 template<
typename _Tp>
3216 using type = __remove_cvref_t<_Tp>;
3219 template<
typename _Tp>
3220 using remove_cvref_t = __remove_cvref_t<_Tp>;
3223 template<
typename _Tp>
3224 struct type_identity {
using type = _Tp; };
3226 template<
typename _Tp>
3227 using type_identity_t =
typename type_identity<_Tp>::type;
3229#define __cpp_lib_unwrap_ref 201811L
3232 template<
typename _Tp>
3233 struct unwrap_reference {
using type = _Tp; };
3235 template<
typename _Tp>
3236 struct unwrap_reference<reference_wrapper<_Tp>> {
using type = _Tp&; };
3238 template<
typename _Tp>
3239 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3242 template<
typename _Tp>
3243 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
3245 template<
typename _Tp>
3246 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3248#define __cpp_lib_bounded_array_traits 201902L
3251 template<
typename _Tp>
3252 struct is_bounded_array
3253 :
public __is_array_known_bounds<_Tp>
3257 template<
typename _Tp>
3258 struct is_unbounded_array
3259 :
public __is_array_unknown_bounds<_Tp>
3262 template<
typename _Tp>
3263 inline constexpr bool is_bounded_array_v
3264 = is_bounded_array<_Tp>::value;
3266 template<
typename _Tp>
3267 inline constexpr bool is_unbounded_array_v
3268 = is_unbounded_array<_Tp>::value;
3270#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
3272#define __cpp_lib_is_constant_evaluated 201811L
3274 constexpr inline bool
3275 is_constant_evaluated() noexcept
3276 {
return __builtin_is_constant_evaluated(); }
3279 template<
typename _From,
typename _To>
3280 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
3282 template<
typename _Xp,
typename _Yp>
3284 =
decltype(
false ? declval<_Xp(&)()>()() : declval<_Yp(&)()>()());
3286 template<
typename _Ap,
typename _Bp,
typename =
void>
3287 struct __common_ref_impl
3291 template<
typename _Ap,
typename _Bp>
3292 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
3295 template<
typename _Xp,
typename _Yp>
3296 struct __common_ref_impl<_Xp&, _Yp&,
3297 __void_t<__cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>>>
3298 {
using type = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>; };
3301 template<
typename _Xp,
typename _Yp>
3302 using __common_ref_C = remove_reference_t<__common_ref<_Xp&, _Yp&>>&&;
3305 template<
typename _Xp,
typename _Yp>
3306 struct __common_ref_impl<_Xp&&, _Yp&&,
3307 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
3308 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
3309 {
using type = __common_ref_C<_Xp, _Yp>; };
3312 template<
typename _Xp,
typename _Yp>
3313 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
3316 template<
typename _Xp,
typename _Yp>
3317 struct __common_ref_impl<_Xp&&, _Yp&,
3318 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
3319 {
using type = __common_ref_D<_Xp, _Yp>; };
3322 template<
typename _Xp,
typename _Yp>
3323 struct __common_ref_impl<_Xp&, _Yp&&>
3324 : __common_ref_impl<_Yp&&, _Xp&>
3327 template<
typename _Tp,
typename _Up,
3328 template<
typename>
class _TQual,
template<
typename>
class _UQual>
3329 struct basic_common_reference
3332 template<
typename _Tp>
3334 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
3336 template<
typename _Tp>
3338 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
3340 template<
typename _Tp>
3341 struct __xref<_Tp&&>
3342 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
3344 template<
typename _Tp1,
typename _Tp2>
3345 using __basic_common_ref
3346 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
3347 remove_cvref_t<_Tp2>,
3348 __xref<_Tp1>::template __type,
3349 __xref<_Tp2>::template __type>::type;
3351 template<
typename... _Tp>
3352 struct common_reference;
3354 template<
typename... _Tp>
3355 using common_reference_t =
typename common_reference<_Tp...>::type;
3359 struct common_reference<>
3363 template<
typename _Tp0>
3364 struct common_reference<_Tp0>
3365 {
using type = _Tp0; };
3367 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1,
typename =
void>
3368 struct __common_reference_impl
3369 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
3373 template<
typename _Tp1,
typename _Tp2>
3374 struct common_reference<_Tp1, _Tp2>
3375 : __common_reference_impl<_Tp1, _Tp2>
3379 template<
typename _Tp1,
typename _Tp2>
3380 struct __common_reference_impl<_Tp1&, _Tp2&, 1,
3381 void_t<__common_ref<_Tp1&, _Tp2&>>>
3382 {
using type = __common_ref<_Tp1&, _Tp2&>; };
3384 template<
typename _Tp1,
typename _Tp2>
3385 struct __common_reference_impl<_Tp1&&, _Tp2&&, 1,
3386 void_t<__common_ref<_Tp1&&, _Tp2&&>>>
3387 {
using type = __common_ref<_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&>; };
3400 template<
typename _Tp1,
typename _Tp2>
3401 struct __common_reference_impl<_Tp1, _Tp2, 2,
3402 void_t<__basic_common_ref<_Tp1, _Tp2>>>
3403 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
3406 template<
typename _Tp1,
typename _Tp2>
3407 struct __common_reference_impl<_Tp1, _Tp2, 3,
3408 void_t<__cond_res<_Tp1, _Tp2>>>
3409 {
using type = __cond_res<_Tp1, _Tp2>; };
3412 template<
typename _Tp1,
typename _Tp2>
3413 struct __common_reference_impl<_Tp1, _Tp2, 4,
3415 {
using type = common_type_t<_Tp1, _Tp2>; };
3418 template<
typename _Tp1,
typename _Tp2>
3419 struct __common_reference_impl<_Tp1, _Tp2, 5, void>
3423 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3424 struct common_reference<_Tp1, _Tp2, _Rest...>
3425 : __common_type_fold<common_reference<_Tp1, _Tp2>,
3426 __common_type_pack<_Rest...>>
3430 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3431 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
3432 __common_type_pack<_Rest...>,
3433 void_t<common_reference_t<_Tp1, _Tp2>>>
3434 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
3439_GLIBCXX_END_NAMESPACE_VERSION
static const size_t alignment_value
The value of the strictest alignment of _Types.
typename remove_reference< _Tp >::type remove_reference_t
Alias template for remove_reference.
typename result_of< _Tp >::type result_of_t
Alias template for result_of.
typename add_rvalue_reference< _Tp >::type add_rvalue_reference_t
Alias template for add_rvalue_reference.
typename make_unsigned< _Tp >::type make_unsigned_t
Alias template for make_unsigned.
void void_t
A metafunction that always yields void, used for detecting valid types.
typename aligned_storage< _Len, _Align >::type aligned_storage_t
Alias template for aligned_storage.
typename remove_cv< _Tp >::type remove_cv_t
Alias template for remove_cv.
typename remove_all_extents< _Tp >::type remove_all_extents_t
Alias template for remove_all_extents.
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
typename conditional< _Cond, _Iftrue, _Iffalse >::type conditional_t
Alias template for conditional.
typename add_const< _Tp >::type add_const_t
Alias template for add_const.
typename remove_pointer< _Tp >::type remove_pointer_t
Alias template for remove_pointer.
typename add_cv< _Tp >::type add_cv_t
Alias template for add_cv.
typename remove_const< _Tp >::type remove_const_t
Alias template for remove_const.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
typename add_volatile< _Tp >::type add_volatile_t
Alias template for add_volatile.
typename remove_volatile< _Tp >::type remove_volatile_t
Alias template for remove_volatile.
typename add_lvalue_reference< _Tp >::type add_lvalue_reference_t
Alias template for add_lvalue_reference.
typename add_pointer< _Tp >::type add_pointer_t
Alias template for add_pointer.
typename remove_extent< _Tp >::type remove_extent_t
Alias template for remove_extent.
typename underlying_type< _Tp >::type underlying_type_t
Alias template for underlying_type.
typename decay< _Tp >::type decay_t
Alias template for decay.
typename make_signed< _Tp >::type make_signed_t
Alias template for make_signed.
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
ISO C++ entities toplevel namespace is std.
constexpr bool is_nothrow_swappable_v
is_nothrow_swappable_v
constexpr bool is_swappable_v
is_swappable_v
constexpr bool is_swappable_with_v
is_swappable_with_v
constexpr bool is_nothrow_swappable_with_v
is_nothrow_swappable_with_v
Define a member typedef type to one of two argument types.
is_member_function_pointer
is_null_pointer (LWG 2247).
__is_nullptr_t (deprecated extension).
is_pod (deprecated in C++20)
is_nothrow_default_constructible
is_nothrow_copy_constructible
is_nothrow_move_constructible
is_nothrow_copy_assignable
is_nothrow_move_assignable
is_trivially_constructible
is_trivially_default_constructible
is_trivially_copy_constructible
is_trivially_move_constructible
is_trivially_copy_assignable
is_trivially_move_assignable
is_trivially_destructible
Provide aligned storage for types.
aligned_storage< _S_len, alignment_value >::type type
The storage.
Primary class template for reference_wrapper.
Define a member typedef type only if a boolean constant is true.
The underlying type of an enum.
Implementation of the detection idiom (negative case).
Metafunctions used for detecting swappable types: p0185r1.
is_nothrow_swappable_with