797 class _GLIBCXX_NO_SPECIALIZATIONS tuple
798 :
public _Tuple_impl<0, _Elements...>
800 using _Inherited = _Tuple_impl<0, _Elements...>;
802#if __cpp_concepts && __cpp_consteval && __cpp_conditional_explicit
803 template<
typename... _UTypes>
804 static consteval bool
807 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
813 template<
typename... _UTypes>
814 static consteval bool
815 __nothrow_constructible()
817 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
823 template<
typename... _UTypes>
824 static consteval bool
827 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
828 return __and_v<is_convertible<_UTypes, _Elements>...>;
835 template<
typename... _UTypes>
836 static consteval bool
837 __disambiguating_constraint()
839 if constexpr (
sizeof...(_Elements) !=
sizeof...(_UTypes))
841 else if constexpr (
sizeof...(_Elements) == 1)
843 using _U0 =
typename _Nth_type<0, _UTypes...>::type;
844 return !is_same_v<remove_cvref_t<_U0>, tuple>;
846 else if constexpr (
sizeof...(_Elements) < 4)
848 using _U0 =
typename _Nth_type<0, _UTypes...>::type;
849 if constexpr (!is_same_v<remove_cvref_t<_U0>, allocator_arg_t>)
853 using _T0 =
typename _Nth_type<0, _Elements...>::type;
854 return is_same_v<remove_cvref_t<_T0>, allocator_arg_t>;
863 template<
typename _Tuple>
864 static consteval bool
867 if constexpr (
sizeof...(_Elements) != 1)
869 else if constexpr (is_same_v<remove_cvref_t<_Tuple>, tuple>)
873 using _Tp =
typename _Nth_type<0, _Elements...>::type;
874 if constexpr (is_convertible_v<_Tuple, _Tp>)
876 else if constexpr (is_constructible_v<_Tp, _Tuple>)
882 template<
typename... _Up>
883 static consteval bool
886#if __has_builtin(__reference_constructs_from_temporary)
887 return (__reference_constructs_from_temporary(_Elements, _Up&&)
894#if __cpp_lib_tuple_like
897 template<
typename _UTuple>
898 static consteval bool
899 __dangles_from_tuple_like()
906 template<
typename _UTuple>
907 static consteval bool
908 __constructible_from_tuple_like()
915 template<
typename _UTuple>
916 static consteval bool
917 __convertible_from_tuple_like()
927 explicit(!(__is_implicitly_default_constructible_v<_Elements> && ...))
929 noexcept((is_nothrow_default_constructible_v<_Elements> && ...))
930 requires (is_default_constructible_v<_Elements> && ...)
935 template<
typename =
void>
936 constexpr explicit(!__convertible<
const _Elements&...>())
937 tuple(
const type_identity_t<_Elements>&... __elements)
938 noexcept(__nothrow_constructible<
const _Elements&...>())
939 requires (__constructible<const _Elements&...>())
940 : _Inherited(__elements...)
943 template<
typename... _UTypes>
944 requires (__disambiguating_constraint<_UTypes...>())
945 && (__constructible<_UTypes...>())
946 && (!__dangles<_UTypes...>())
947 constexpr explicit(!__convertible<_UTypes...>())
948 tuple(_UTypes&&... __u)
949 noexcept(__nothrow_constructible<_UTypes...>())
953 template<
typename... _UTypes>
954 requires (__disambiguating_constraint<_UTypes...>())
955 && (__constructible<_UTypes...>())
956 && (__dangles<_UTypes...>())
957 tuple(_UTypes&&...) =
delete;
959 constexpr tuple(
const tuple&) =
default;
962 tuple(tuple&&)
requires (is_move_constructible_v<_Elements> && ...)
965 template<
typename... _UTypes>
966 requires (__constructible<
const _UTypes&...>())
967 && (!__use_other_ctor<
const tuple<_UTypes...>&>())
968 && (!__dangles<
const _UTypes&...>())
969 constexpr explicit(!__convertible<const _UTypes&...>())
970 tuple(
const tuple<_UTypes...>& __u)
971 noexcept(__nothrow_constructible<
const _UTypes&...>())
972 : _Inherited(
static_cast<const _Tuple_impl<0, _UTypes...
>&>(__u))
975 template<
typename... _UTypes>
976 requires (__constructible<
const _UTypes&...>())
977 && (!__use_other_ctor<
const tuple<_UTypes...>&>())
978 && (__dangles<
const _UTypes&...>())
979 tuple(
const tuple<_UTypes...>&) =
delete;
981 template<
typename... _UTypes>
982 requires (__constructible<_UTypes...>())
983 && (!__use_other_ctor<tuple<_UTypes...>>())
984 && (!__dangles<_UTypes...>())
985 constexpr explicit(!__convertible<_UTypes...>())
986 tuple(tuple<_UTypes...>&& __u)
987 noexcept(__nothrow_constructible<_UTypes...>())
988 : _Inherited(
static_cast<_Tuple_impl<0, _UTypes...
>&&>(__u))
991 template<
typename... _UTypes>
992 requires (__constructible<_UTypes...>())
993 && (!__use_other_ctor<tuple<_UTypes...>>())
994 && (__dangles<_UTypes...>())
995 tuple(tuple<_UTypes...>&&) =
delete;
997#if __cpp_lib_ranges_zip
998 template<
typename... _UTypes>
999 requires (__constructible<_UTypes&...>())
1000 && (!__use_other_ctor<tuple<_UTypes...>&>())
1001 && (!__dangles<_UTypes&...>())
1002 constexpr explicit(!__convertible<_UTypes&...>())
1003 tuple(tuple<_UTypes...>& __u)
1004 noexcept(__nothrow_constructible<_UTypes&...>())
1005 : _Inherited(
static_cast<_Tuple_impl<0, _UTypes...
>&>(__u))
1008 template<
typename... _UTypes>
1009 requires (__constructible<_UTypes&...>())
1010 && (!__use_other_ctor<tuple<_UTypes...>&>())
1011 && (__dangles<_UTypes&...>())
1012 tuple(tuple<_UTypes...>&) =
delete;
1014 template<
typename... _UTypes>
1015 requires (__constructible<
const _UTypes...>())
1016 && (!__use_other_ctor<
const tuple<_UTypes...>>())
1017 && (!__dangles<
const _UTypes...>())
1018 constexpr explicit(!__convertible<const _UTypes...>())
1019 tuple(
const tuple<_UTypes...>&& __u)
1020 noexcept(__nothrow_constructible<
const _UTypes...>())
1021 : _Inherited(
static_cast<const _Tuple_impl<0, _UTypes...
>&&>(__u))
1024 template<
typename... _UTypes>
1025 requires (__constructible<
const _UTypes...>())
1026 && (!__use_other_ctor<
const tuple<_UTypes...>>())
1027 && (__dangles<
const _UTypes...>())
1028 tuple(
const tuple<_UTypes...>&&) =
delete;
1031 template<
typename _U1,
typename _U2>
1032 requires (
sizeof...(_Elements) == 2)
1033 && (__constructible<const _U1&, const _U2&>())
1034 && (!__dangles<const _U1&, const _U2&>())
1035 constexpr explicit(!__convertible<const _U1&, const _U2&>())
1037 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
1038 : _Inherited(__u.first, __u.second)
1041 template<
typename _U1,
typename _U2>
1042 requires (
sizeof...(_Elements) == 2)
1043 && (__constructible<const _U1&, const _U2&>())
1044 && (__dangles<const _U1&, const _U2&>())
1047 template<
typename _U1,
typename _U2>
1048 requires (
sizeof...(_Elements) == 2)
1049 && (__constructible<_U1, _U2>())
1050 && (!__dangles<_U1, _U2>())
1051 constexpr explicit(!__convertible<_U1, _U2>())
1053 noexcept(__nothrow_constructible<_U1, _U2>())
1058 template<
typename _U1,
typename _U2>
1059 requires (
sizeof...(_Elements) == 2)
1060 && (__constructible<_U1, _U2>())
1061 && (__dangles<_U1, _U2>())
1064#if __cpp_lib_ranges_zip
1065 template<
typename _U1,
typename _U2>
1066 requires (
sizeof...(_Elements) == 2)
1067 && (__constructible<_U1&, _U2&>())
1068 && (!__dangles<_U1&, _U2&>())
1069 constexpr explicit(!__convertible<_U1&, _U2&>())
1071 noexcept(__nothrow_constructible<_U1&, _U2&>())
1072 : _Inherited(__u.first, __u.second)
1075 template<
typename _U1,
typename _U2>
1076 requires (
sizeof...(_Elements) == 2)
1077 && (__constructible<_U1&, _U2&>())
1078 && (__dangles<_U1&, _U2&>())
1081 template<
typename _U1,
typename _U2>
1082 requires (
sizeof...(_Elements) == 2)
1083 && (__constructible<const _U1, const _U2>())
1084 && (!__dangles<const _U1, const _U2>())
1085 constexpr explicit(!__convertible<const _U1, const _U2>())
1087 noexcept(__nothrow_constructible<const _U1, const _U2>())
1092 template<
typename _U1,
typename _U2>
1093 requires (
sizeof...(_Elements) == 2)
1094 && (__constructible<const _U1, const _U2>())
1095 && (__dangles<const _U1, const _U2>())
1099#if __cpp_lib_tuple_like
1100 template<__eligible_tuple_like<tuple> _UTuple>
1101 requires (__constructible_from_tuple_like<_UTuple>())
1102 && (!__use_other_ctor<_UTuple>())
1103 && (!__dangles_from_tuple_like<_UTuple>())
1104 constexpr explicit(!__convertible_from_tuple_like<_UTuple>())
1105 tuple(_UTuple&& __u)
1106 : _Inherited(__tuple_like_tag_t{},
1111 template<__eligible_tuple_like<tuple> _UTuple>
1112 requires (__constructible_from_tuple_like<_UTuple>())
1113 && (!__use_other_ctor<_UTuple>())
1114 && (__dangles_from_tuple_like<_UTuple>())
1115 tuple(_UTuple&&) =
delete;
1120 template<
typename _Alloc>
1122 explicit(!(__is_implicitly_default_constructible_v<_Elements> && ...))
1123 tuple(allocator_arg_t __tag,
const _Alloc& __a)
1124 requires (is_default_constructible_v<_Elements> && ...)
1125 : _Inherited(__tag, __a)
1128 template<
typename _Alloc>
1129 constexpr explicit(!__convertible<
const _Elements&...>())
1130 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1131 const type_identity_t<_Elements>&... __elements)
1132 requires (__constructible<
const _Elements&...>())
1133 : _Inherited(__tag, __a, __elements...)
1136 template<
typename _Alloc,
typename... _UTypes>
1137 requires (__disambiguating_constraint<_UTypes...>())
1138 && (__constructible<_UTypes...>())
1139 && (!__dangles<_UTypes...>())
1140 constexpr explicit(!__convertible<_UTypes...>())
1141 tuple(allocator_arg_t __tag,
const _Alloc& __a, _UTypes&&... __u)
1145 template<
typename _Alloc,
typename... _UTypes>
1146 requires (__disambiguating_constraint<_UTypes...>())
1147 && (__constructible<_UTypes...>())
1148 && (__dangles<_UTypes...>())
1149 tuple(allocator_arg_t,
const _Alloc&, _UTypes&&...) =
delete;
1151 template<
typename _Alloc>
1153 tuple(allocator_arg_t __tag,
const _Alloc& __a,
const tuple& __u)
1154 : _Inherited(__tag, __a,
static_cast<const _Inherited&
>(__u))
1157 template<
typename _Alloc>
1158 requires (__constructible<_Elements...>())
1160 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple&& __u)
1161 : _Inherited(__tag, __a,
static_cast<_Inherited&&
>(__u))
1164 template<
typename _Alloc,
typename... _UTypes>
1165 requires (__constructible<
const _UTypes&...>())
1166 && (!__use_other_ctor<
const tuple<_UTypes...>&>())
1167 && (!__dangles<
const _UTypes&...>())
1168 constexpr explicit(!__convertible<const _UTypes&...>())
1169 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1170 const tuple<_UTypes...>& __u)
1171 : _Inherited(__tag, __a,
1172 static_cast<const _Tuple_impl<0, _UTypes...
>&>(__u))
1175 template<
typename _Alloc,
typename... _UTypes>
1176 requires (__constructible<
const _UTypes&...>())
1177 && (!__use_other_ctor<
const tuple<_UTypes...>&>())
1178 && (__dangles<
const _UTypes&...>())
1179 tuple(allocator_arg_t,
const _Alloc&,
const tuple<_UTypes...>&) =
delete;
1181 template<
typename _Alloc,
typename... _UTypes>
1182 requires (__constructible<_UTypes...>())
1183 && (!__use_other_ctor<tuple<_UTypes...>>())
1184 && (!__dangles<_UTypes...>())
1185 constexpr explicit(!__use_other_ctor<tuple<_UTypes...>>())
1186 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple<_UTypes...>&& __u)
1187 : _Inherited(__tag, __a,
static_cast<_Tuple_impl<0, _UTypes...
>&&>(__u))
1190 template<
typename _Alloc,
typename... _UTypes>
1191 requires (__constructible<_UTypes...>())
1192 && (!__use_other_ctor<tuple<_UTypes...>>())
1193 && (__dangles<_UTypes...>())
1194 tuple(allocator_arg_t,
const _Alloc&, tuple<_UTypes...>&&) =
delete;
1196#if __cpp_lib_ranges_zip
1197 template<
typename _Alloc,
typename... _UTypes>
1198 requires (__constructible<_UTypes&...>())
1199 && (!__use_other_ctor<tuple<_UTypes...>&>())
1200 && (!__dangles<_UTypes&...>())
1201 constexpr explicit(!__convertible<_UTypes&...>())
1202 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple<_UTypes...>& __u)
1203 : _Inherited(__tag, __a,
static_cast<_Tuple_impl<0, _UTypes...
>&>(__u))
1206 template<
typename _Alloc,
typename... _UTypes>
1207 requires (__constructible<_UTypes&...>())
1208 && (!__use_other_ctor<tuple<_UTypes...>&>())
1209 && (__dangles<_UTypes&...>())
1210 tuple(allocator_arg_t,
const _Alloc&, tuple<_UTypes...>&) =
delete;
1212 template<
typename _Alloc,
typename... _UTypes>
1213 requires (__constructible<
const _UTypes...>())
1214 && (!__use_other_ctor<
const tuple<_UTypes...>>())
1215 && (!__dangles<
const _UTypes...>())
1216 constexpr explicit(!__convertible<const _UTypes...>())
1217 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1218 const tuple<_UTypes...>&& __u)
1219 : _Inherited(__tag, __a,
1220 static_cast<const _Tuple_impl<0, _UTypes...
>&&>(__u))
1223 template<
typename _Alloc,
typename... _UTypes>
1224 requires (__constructible<
const _UTypes...>())
1225 && (!__use_other_ctor<
const tuple<_UTypes...>>())
1226 && (__dangles<
const _UTypes...>())
1227 tuple(allocator_arg_t,
const _Alloc&,
const tuple<_UTypes...>&&) =
delete;
1230 template<
typename _Alloc,
typename _U1,
typename _U2>
1231 requires (
sizeof...(_Elements) == 2)
1232 && (__constructible<const _U1&, const _U2&>())
1233 && (!__dangles<const _U1&, const _U2&>())
1234 constexpr explicit(!__convertible<const _U1&, const _U2&>())
1235 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1237 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
1238 : _Inherited(__tag, __a, __u.first, __u.second)
1241 template<
typename _Alloc,
typename _U1,
typename _U2>
1242 requires (
sizeof...(_Elements) == 2)
1243 && (__constructible<const _U1&, const _U2&>())
1244 && (__dangles<const _U1&, const _U2&>())
1245 tuple(allocator_arg_t,
const _Alloc&,
const pair<_U1, _U2>&) =
delete;
1247 template<
typename _Alloc,
typename _U1,
typename _U2>
1248 requires (
sizeof...(_Elements) == 2)
1249 && (__constructible<_U1, _U2>())
1250 && (!__dangles<_U1, _U2>())
1251 constexpr explicit(!__convertible<_U1, _U2>())
1252 tuple(allocator_arg_t __tag,
const _Alloc& __a,
pair<_U1, _U2>&& __u)
1253 noexcept(__nothrow_constructible<_U1, _U2>())
1257 template<
typename _Alloc,
typename _U1,
typename _U2>
1258 requires (
sizeof...(_Elements) == 2)
1259 && (__constructible<_U1, _U2>())
1260 && (__dangles<_U1, _U2>())
1261 tuple(allocator_arg_t,
const _Alloc&,
pair<_U1, _U2>&&) =
delete;
1263#if __cpp_lib_ranges_zip
1264 template<
typename _Alloc,
typename _U1,
typename _U2>
1265 requires (
sizeof...(_Elements) == 2)
1266 && (__constructible<_U1&, _U2&>())
1267 && (!__dangles<_U1&, _U2&>())
1268 constexpr explicit(!__convertible<_U1&, _U2&>())
1269 tuple(allocator_arg_t __tag,
const _Alloc& __a,
pair<_U1, _U2>& __u)
1270 noexcept(__nothrow_constructible<_U1&, _U2&>())
1271 : _Inherited(__tag, __a, __u.first, __u.second)
1274 template<
typename _Alloc,
typename _U1,
typename _U2>
1275 requires (
sizeof...(_Elements) == 2)
1276 && (__constructible<_U1&, _U2&>())
1277 && (__dangles<_U1&, _U2&>())
1280 template<
typename _Alloc,
typename _U1,
typename _U2>
1281 requires (
sizeof...(_Elements) == 2)
1282 && (__constructible<const _U1, const _U2>())
1283 && (!__dangles<const _U1, const _U2>())
1284 constexpr explicit(!__convertible<const _U1, const _U2>())
1285 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1287 noexcept(__nothrow_constructible<const _U1, const _U2>())
1291 template<
typename _Alloc,
typename _U1,
typename _U2>
1292 requires (
sizeof...(_Elements) == 2)
1293 && (__constructible<const _U1, const _U2>())
1294 && (__dangles<const _U1, const _U2>())
1295 tuple(allocator_arg_t,
const _Alloc&,
const pair<_U1, _U2>&&) =
delete;
1298#if __cpp_lib_tuple_like
1299 template<
typename _Alloc, __eligible_tuple_like<tuple> _UTuple>
1300 requires (__constructible_from_tuple_like<_UTuple>())
1301 && (!__use_other_ctor<_UTuple>())
1302 && (!__dangles_from_tuple_like<_UTuple>())
1303 constexpr explicit(!__convertible_from_tuple_like<_UTuple>())
1304 tuple(allocator_arg_t __tag,
const _Alloc& __a, _UTuple&& __u)
1305 : _Inherited(__tuple_like_tag_t{},
1310 template<
typename _Alloc, __eligible_tuple_like<tuple> _UTuple>
1311 requires (__constructible_from_tuple_like<_UTuple>())
1312 && (!__use_other_ctor<_UTuple>())
1313 && (__dangles_from_tuple_like<_UTuple>())
1314 tuple(allocator_arg_t,
const _Alloc&, _UTuple&&) =
delete;
1319 template<
bool _Cond>
1320 using _TCC = _TupleConstraints<_Cond, _Elements...>;
1323 template<
bool _Dummy>
1324 using _ImplicitDefaultCtor = __enable_if_t<
1325 _TCC<_Dummy>::__is_implicitly_default_constructible(),
1329 template<
bool _Dummy>
1330 using _ExplicitDefaultCtor = __enable_if_t<
1331 _TCC<_Dummy>::__is_explicitly_default_constructible(),
1335 template<
bool _Cond,
typename... _Args>
1336 using _ImplicitCtor = __enable_if_t<
1337 _TCC<_Cond>::template __is_implicitly_constructible<_Args...>(),
1341 template<
bool _Cond,
typename... _Args>
1342 using _ExplicitCtor = __enable_if_t<
1343 _TCC<_Cond>::template __is_explicitly_constructible<_Args...>(),
1347 template<
typename... _UElements>
1348 static constexpr bool __nothrow_constructible()
1351 __and_<is_nothrow_constructible<_Elements, _UElements>...>::value;
1355 template<
typename _Up>
1356 static constexpr bool __valid_args()
1358 return sizeof...(_Elements) == 1
1359 && !
is_same<tuple, __remove_cvref_t<_Up>>::value;
1363 template<
typename,
typename,
typename... _Tail>
1364 static constexpr bool __valid_args()
1365 {
return (
sizeof...(_Tail) + 2) ==
sizeof...(_Elements); }
1376 template<
typename _Tuple,
typename = tuple,
1377 typename = __remove_cvref_t<_Tuple>>
1378 struct _UseOtherCtor
1383 template<
typename _Tuple,
typename _Tp,
typename _Up>
1384 struct _UseOtherCtor<_Tuple, tuple<_Tp>, tuple<_Up>>
1385 : __or_<is_convertible<_Tuple, _Tp>, is_constructible<_Tp, _Tuple>>::type
1389 template<
typename _Tuple,
typename _Tp>
1390 struct _UseOtherCtor<_Tuple, tuple<_Tp>, tuple<_Tp>>
1397 template<
typename _Tuple>
1398 static constexpr bool __use_other_ctor()
1399 {
return _UseOtherCtor<_Tuple>::value; }
1402#undef __glibcxx_no_dangling_refs
1403#if __has_builtin(__reference_constructs_from_temporary) \
1404 && defined _GLIBCXX_DEBUG
1406# if __cpp_fold_expressions
1407# define __glibcxx_dangling_refs(U) \
1408 (__reference_constructs_from_temporary(_Elements, U) || ...)
1410# define __glibcxx_dangling_refs(U) \
1411 __or_<__bool_constant<__reference_constructs_from_temporary(_Elements, U) \
1414# define __glibcxx_no_dangling_refs(U) \
1415 static_assert(!__glibcxx_dangling_refs(U), \
1416 "std::tuple constructor creates a dangling reference")
1418# define __glibcxx_no_dangling_refs(U)
1423 template<
typename _Dummy = void,
1424 _ImplicitDefaultCtor<is_void<_Dummy>::value> =
true>
1427 noexcept(__and_<is_nothrow_default_constructible<_Elements>...>::value)
1430 template<
typename _Dummy = void,
1431 _ExplicitDefaultCtor<is_void<_Dummy>::value> =
false>
1434 noexcept(__and_<is_nothrow_default_constructible<_Elements>...>::value)
1437 template<
bool _NotEmpty = (
sizeof...(_Elements) >= 1),
1438 _ImplicitCtor<_NotEmpty, const _Elements&...> =
true>
1440 tuple(
const __type_identity_t<_Elements>&... __elements)
1441 noexcept(__nothrow_constructible<
const _Elements&...>())
1442 : _Inherited(__elements...) { }
1444 template<
bool _NotEmpty = (
sizeof...(_Elements) >= 1),
1445 _ExplicitCtor<_NotEmpty, const _Elements&...> =
false>
1447 tuple(
const __type_identity_t<_Elements>&... __elements)
1448 noexcept(__nothrow_constructible<
const _Elements&...>())
1449 : _Inherited(__elements...) { }
1451 template<
typename... _UElements,
1452 bool _Valid = __valid_args<_UElements...>(),
1453 _ImplicitCtor<_Valid, _UElements...> =
true>
1455 tuple(_UElements&&... __elements)
1456 noexcept(__nothrow_constructible<_UElements...>())
1458 { __glibcxx_no_dangling_refs(_UElements&&); }
1460 template<
typename... _UElements,
1461 bool _Valid = __valid_args<_UElements...>(),
1462 _ExplicitCtor<_Valid, _UElements...> =
false>
1464 tuple(_UElements&&... __elements)
1465 noexcept(__nothrow_constructible<_UElements...>())
1467 { __glibcxx_no_dangling_refs(_UElements&&); }
1469 constexpr tuple(
const tuple&) =
default;
1471 constexpr tuple(tuple&&) =
default;
1473 template<
typename... _UElements,
1474 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1475 && !__use_other_ctor<
const tuple<_UElements...>&>(),
1476 _ImplicitCtor<_Valid,
const _UElements&...> =
true>
1478 tuple(
const tuple<_UElements...>& __in)
1479 noexcept(__nothrow_constructible<
const _UElements&...>())
1480 : _Inherited(
static_cast<const _Tuple_impl<0, _UElements...
>&>(__in))
1481 { __glibcxx_no_dangling_refs(
const _UElements&); }
1483 template<
typename... _UElements,
1484 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1485 && !__use_other_ctor<
const tuple<_UElements...>&>(),
1486 _ExplicitCtor<_Valid,
const _UElements&...> =
false>
1488 tuple(
const tuple<_UElements...>& __in)
1489 noexcept(__nothrow_constructible<
const _UElements&...>())
1490 : _Inherited(
static_cast<const _Tuple_impl<0, _UElements...
>&>(__in))
1491 { __glibcxx_no_dangling_refs(
const _UElements&); }
1493 template<
typename... _UElements,
1494 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1495 && !__use_other_ctor<tuple<_UElements...>&&>(),
1496 _ImplicitCtor<_Valid, _UElements...> =
true>
1498 tuple(tuple<_UElements...>&& __in)
1499 noexcept(__nothrow_constructible<_UElements...>())
1500 : _Inherited(
static_cast<_Tuple_impl<0, _UElements...
>&&>(__in))
1501 { __glibcxx_no_dangling_refs(_UElements&&); }
1503 template<
typename... _UElements,
1504 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1505 && !__use_other_ctor<tuple<_UElements...>&&>(),
1506 _ExplicitCtor<_Valid, _UElements...> =
false>
1508 tuple(tuple<_UElements...>&& __in)
1509 noexcept(__nothrow_constructible<_UElements...>())
1510 : _Inherited(
static_cast<_Tuple_impl<0, _UElements...
>&&>(__in))
1511 { __glibcxx_no_dangling_refs(_UElements&&); }
1515 template<
typename _Alloc,
1516 _ImplicitDefaultCtor<is_object<_Alloc>::value> =
true>
1517 _GLIBCXX20_CONSTEXPR
1518 tuple(allocator_arg_t __tag,
const _Alloc& __a)
1519 : _Inherited(__tag, __a) { }
1521 template<
typename _Alloc,
1522 _ExplicitDefaultCtor<is_object<_Alloc>::value> =
false>
1523 _GLIBCXX20_CONSTEXPR
1525 tuple(allocator_arg_t __tag,
const _Alloc& __a)
1526 : _Inherited(__tag, __a) { }
1528 template<
typename _Alloc,
bool _NotEmpty = (
sizeof...(_Elements) >= 1),
1529 _ImplicitCtor<_NotEmpty, const _Elements&...> =
true>
1530 _GLIBCXX20_CONSTEXPR
1531 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1532 const __type_identity_t<_Elements>&... __elements)
1533 : _Inherited(__tag, __a, __elements...) { }
1535 template<
typename _Alloc,
bool _NotEmpty = (
sizeof...(_Elements) >= 1),
1536 _ExplicitCtor<_NotEmpty, const _Elements&...> =
false>
1537 _GLIBCXX20_CONSTEXPR
1539 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1540 const __type_identity_t<_Elements>&... __elements)
1541 : _Inherited(__tag, __a, __elements...) { }
1543 template<
typename _Alloc,
typename... _UElements,
1544 bool _Valid = __valid_args<_UElements...>(),
1545 _ImplicitCtor<_Valid, _UElements...> =
true>
1546 _GLIBCXX20_CONSTEXPR
1547 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1548 _UElements&&... __elements)
1550 { __glibcxx_no_dangling_refs(_UElements&&); }
1552 template<
typename _Alloc,
typename... _UElements,
1553 bool _Valid = __valid_args<_UElements...>(),
1554 _ExplicitCtor<_Valid, _UElements...> =
false>
1555 _GLIBCXX20_CONSTEXPR
1557 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1558 _UElements&&... __elements)
1560 { __glibcxx_no_dangling_refs(_UElements&&); }
1562 template<
typename _Alloc>
1563 _GLIBCXX20_CONSTEXPR
1564 tuple(allocator_arg_t __tag,
const _Alloc& __a,
const tuple& __in)
1565 : _Inherited(__tag, __a,
static_cast<const _Inherited&
>(__in)) { }
1567 template<
typename _Alloc>
1568 _GLIBCXX20_CONSTEXPR
1569 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple&& __in)
1570 : _Inherited(__tag, __a,
static_cast<_Inherited&&
>(__in)) { }
1572 template<
typename _Alloc,
typename... _UElements,
1573 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1574 && !__use_other_ctor<
const tuple<_UElements...>&>(),
1575 _ImplicitCtor<_Valid,
const _UElements&...> =
true>
1576 _GLIBCXX20_CONSTEXPR
1577 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1578 const tuple<_UElements...>& __in)
1579 : _Inherited(__tag, __a,
1580 static_cast<const _Tuple_impl<0, _UElements...
>&>(__in))
1581 { __glibcxx_no_dangling_refs(
const _UElements&); }
1583 template<
typename _Alloc,
typename... _UElements,
1584 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1585 && !__use_other_ctor<
const tuple<_UElements...>&>(),
1586 _ExplicitCtor<_Valid,
const _UElements&...> =
false>
1587 _GLIBCXX20_CONSTEXPR
1589 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1590 const tuple<_UElements...>& __in)
1591 : _Inherited(__tag, __a,
1592 static_cast<const _Tuple_impl<0, _UElements...
>&>(__in))
1593 { __glibcxx_no_dangling_refs(
const _UElements&); }
1595 template<
typename _Alloc,
typename... _UElements,
1596 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1597 && !__use_other_ctor<tuple<_UElements...>&&>(),
1598 _ImplicitCtor<_Valid, _UElements...> =
true>
1599 _GLIBCXX20_CONSTEXPR
1600 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1601 tuple<_UElements...>&& __in)
1602 : _Inherited(__tag, __a,
1603 static_cast<_Tuple_impl<0, _UElements...
>&&>(__in))
1604 { __glibcxx_no_dangling_refs(_UElements&&); }
1606 template<
typename _Alloc,
typename... _UElements,
1607 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1608 && !__use_other_ctor<tuple<_UElements...>&&>(),
1609 _ExplicitCtor<_Valid, _UElements...> =
false>
1610 _GLIBCXX20_CONSTEXPR
1612 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1613 tuple<_UElements...>&& __in)
1614 : _Inherited(__tag, __a,
1615 static_cast<_Tuple_impl<0, _UElements...
>&&>(__in))
1616 { __glibcxx_no_dangling_refs(_UElements&&); }
1621#if __cpp_concepts && __cpp_consteval
1623 template<
typename... _UTypes>
1624 static consteval bool
1627 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
1633 template<
typename... _UTypes>
1634 static consteval bool
1635 __nothrow_assignable()
1637 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
1643#if __cpp_lib_ranges_zip
1644 template<
typename... _UTypes>
1645 static consteval bool
1646 __const_assignable()
1648 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
1655#if __cpp_lib_tuple_like
1656 template<
typename _UTuple>
1657 static consteval bool
1658 __assignable_from_tuple_like()
1665 template<
typename _UTuple>
1666 static consteval bool
1667 __const_assignable_from_tuple_like()
1677 tuple& operator=(
const tuple& __u) =
delete;
1680 operator=(
const tuple& __u)
1681 noexcept(__nothrow_assignable<
const _Elements&...>())
1682 requires (__assignable<const _Elements&...>())
1684 this->_M_assign(__u);
1689 operator=(tuple&& __u)
1690 noexcept(__nothrow_assignable<_Elements...>())
1691 requires (__assignable<_Elements...>())
1697 template<
typename... _UTypes>
1698 requires (__assignable<
const _UTypes&...>())
1700 operator=(
const tuple<_UTypes...>& __u)
1701 noexcept(__nothrow_assignable<
const _UTypes&...>())
1703 this->_M_assign(__u);
1707 template<
typename... _UTypes>
1708 requires (__assignable<_UTypes...>())
1710 operator=(tuple<_UTypes...>&& __u)
1711 noexcept(__nothrow_assignable<_UTypes...>())
1717#if __cpp_lib_ranges_zip
1718 constexpr const tuple&
1719 operator=(
const tuple& __u)
const
1720 requires (__const_assignable<
const _Elements&...>())
1722 this->_M_assign(__u);
1726 constexpr const tuple&
1727 operator=(tuple&& __u)
const
1728 requires (__const_assignable<_Elements...>())
1734 template<
typename... _UTypes>
1735 constexpr const tuple&
1736 operator=(
const tuple<_UTypes...>& __u)
const
1737 requires (__const_assignable<
const _UTypes&...>())
1739 this->_M_assign(__u);
1743 template<
typename... _UTypes>
1744 constexpr const tuple&
1745 operator=(tuple<_UTypes...>&& __u)
const
1746 requires (__const_assignable<_UTypes...>())
1753 template<
typename _U1,
typename _U2>
1754 requires (__assignable<const _U1&, const _U2&>())
1757 noexcept(__nothrow_assignable<const _U1&, const _U2&>())
1759 this->_M_head(*
this) = __u.first;
1760 this->_M_tail(*this)._M_head(*
this) = __u.second;
1764 template<
typename _U1,
typename _U2>
1765 requires (__assignable<_U1, _U2>())
1768 noexcept(__nothrow_assignable<_U1, _U2>())
1775#if __cpp_lib_ranges_zip
1776 template<
typename _U1,
typename _U2>
1777 requires (__const_assignable<const _U1&, const _U2>())
1778 constexpr const tuple&
1781 this->_M_head(*
this) = __u.first;
1782 this->_M_tail(*this)._M_head(*
this) = __u.second;
1786 template<
typename _U1,
typename _U2>
1787 requires (__const_assignable<_U1, _U2>())
1788 constexpr const tuple&
1797#if __cpp_lib_tuple_like
1798 template<__eligible_tuple_like<tuple> _UTuple>
1799 requires (__assignable_from_tuple_like<_UTuple>())
1801 operator=(_UTuple&& __u)
1807 template<__eligible_tuple_like<tuple> _UTuple>
1808 requires (__const_assignable_from_tuple_like<_UTuple>())
1809 constexpr const tuple&
1810 operator=(_UTuple&& __u)
const
1816 template<__tuple_like _UTuple>
1817 requires (!__is_tuple_v<_UTuple>)
1818 friend constexpr bool
1819 operator== [[nodiscard]] (
const tuple& __t,
const _UTuple& __u)
1821 static_assert(
sizeof...(_Elements) == tuple_size_v<_UTuple>,
1822 "tuple objects can only be compared if they have equal sizes.");
1824 return (
bool(std::get<_Is>(__t) == std::get<_Is>(__u))
1829 template<__tuple_like _UTuple,
1831 struct __tuple_like_common_comparison_category;
1833 template<__tuple_like _UTuple,
size_t... _Is>
1835 {
typename void_t<__detail::__synth3way_t<_Elements, tuple_element_t<_Is, _UTuple>>...>; }
1836 struct __tuple_like_common_comparison_category<_UTuple,
index_sequence<_Is...>>
1838 using type = common_comparison_category_t
1839 <__detail::__synth3way_t<_Elements, tuple_element_t<_Is, _UTuple>>...>;
1842 template<__tuple_like _UTuple>
1843 requires (!__is_tuple_v<_UTuple>)
1844 friend constexpr typename __tuple_like_common_comparison_category<_UTuple>::type
1845 operator<=>(
const tuple& __t,
const _UTuple& __u)
1847 using _Cat =
typename __tuple_like_common_comparison_category<_UTuple>::type;
1855 template<
typename... _UElements>
1857 __enable_if_t<
sizeof...(_UElements) ==
sizeof...(_Elements),
bool>
1859 {
return __and_<is_assignable<_Elements&, _UElements>...>::value; }
1862 template<
typename... _UElements>
1863 static constexpr bool __nothrow_assignable()
1866 __and_<is_nothrow_assignable<_Elements&, _UElements>...>::value;
1871 _GLIBCXX20_CONSTEXPR
1873 operator=(__conditional_t<__assignable<const _Elements&...>(),
1875 const __nonesuch&> __in)
1876 noexcept(__nothrow_assignable<
const _Elements&...>())
1878 this->_M_assign(__in);
1882 _GLIBCXX20_CONSTEXPR
1884 operator=(__conditional_t<__assignable<_Elements...>(),
1887 noexcept(__nothrow_assignable<_Elements...>())
1893 template<
typename... _UElements>
1894 _GLIBCXX20_CONSTEXPR
1895 __enable_if_t<__assignable<
const _UElements&...>(), tuple&>
1896 operator=(
const tuple<_UElements...>& __in)
1897 noexcept(__nothrow_assignable<
const _UElements&...>())
1899 this->_M_assign(__in);
1903 template<
typename... _UElements>
1904 _GLIBCXX20_CONSTEXPR
1905 __enable_if_t<__assignable<_UElements...>(), tuple&>
1906 operator=(tuple<_UElements...>&& __in)
1907 noexcept(__nothrow_assignable<_UElements...>())
1915 _GLIBCXX20_CONSTEXPR
1918 noexcept(__and_<__is_nothrow_swappable<_Elements>...>::value)
1919 { _Inherited::_M_swap(__in); }
1921#if __cpp_lib_ranges_zip
1929 swap(
const tuple& __in)
const
1930 noexcept(__and_v<__is_nothrow_swappable<const _Elements>...>)
1931 requires (is_swappable_v<const _Elements> && ...)
1932 { _Inherited::_M_swap(__in); }
2032 class tuple<_T1, _T2> :
public _Tuple_impl<0, _T1, _T2>
2034 typedef _Tuple_impl<0, _T1, _T2> _Inherited;
2037 template<
bool _Dummy,
typename _U1,
typename _U2>
2038 using _ImplicitDefaultCtor = __enable_if_t<
2039 _TupleConstraints<_Dummy, _U1, _U2>::
2040 __is_implicitly_default_constructible(),
2044 template<
bool _Dummy,
typename _U1,
typename _U2>
2045 using _ExplicitDefaultCtor = __enable_if_t<
2046 _TupleConstraints<_Dummy, _U1, _U2>::
2047 __is_explicitly_default_constructible(),
2050 template<
bool _Dummy>
2051 using _TCC = _TupleConstraints<_Dummy, _T1, _T2>;
2054 template<
bool _Cond,
typename _U1,
typename _U2>
2055 using _ImplicitCtor = __enable_if_t<
2056 _TCC<_Cond>::template __is_implicitly_constructible<_U1, _U2>(),
2060 template<
bool _Cond,
typename _U1,
typename _U2>
2061 using _ExplicitCtor = __enable_if_t<
2062 _TCC<_Cond>::template __is_explicitly_constructible<_U1, _U2>(),
2065 template<
typename _U1,
typename _U2>
2066 static constexpr bool __assignable()
2068 return __and_<is_assignable<_T1&, _U1>,
2072 template<
typename _U1,
typename _U2>
2073 static constexpr bool __nothrow_assignable()
2075 return __and_<is_nothrow_assignable<_T1&, _U1>,
2079 template<
typename _U1,
typename _U2>
2080 static constexpr bool __nothrow_constructible()
2082 return __and_<is_nothrow_constructible<_T1, _U1>,
2086 static constexpr bool __nothrow_default_constructible()
2088 return __and_<is_nothrow_default_constructible<_T1>,
2092 template<
typename _U1>
2093 static constexpr bool __is_alloc_arg()
2097#undef __glibcxx_no_dangling_refs
2099#if __has_builtin(__reference_constructs_from_temporary) \
2100 && defined _GLIBCXX_DEBUG
2101# define __glibcxx_no_dangling_refs(_U1, _U2) \
2102 static_assert(!__reference_constructs_from_temporary(_T1, _U1) \
2103 && !__reference_constructs_from_temporary(_T2, _U2), \
2104 "std::tuple constructor creates a dangling reference")
2106# define __glibcxx_no_dangling_refs(_U1, _U2)
2111 template<
bool _Dummy =
true,
2112 _ImplicitDefaultCtor<_Dummy, _T1, _T2> =
true>
2115 noexcept(__nothrow_default_constructible())
2118 template<
bool _Dummy =
true,
2119 _ExplicitDefaultCtor<_Dummy, _T1, _T2> =
false>
2122 noexcept(__nothrow_default_constructible())
2125 template<
bool _Dummy =
true,
2126 _ImplicitCtor<_Dummy, const _T1&, const _T2&> =
true>
2128 tuple(
const _T1& __a1,
const _T2& __a2)
2129 noexcept(__nothrow_constructible<const _T1&, const _T2&>())
2130 : _Inherited(__a1, __a2) { }
2132 template<
bool _Dummy =
true,
2133 _ExplicitCtor<_Dummy, const _T1&, const _T2&> =
false>
2135 tuple(
const _T1& __a1,
const _T2& __a2)
2136 noexcept(__nothrow_constructible<const _T1&, const _T2&>())
2137 : _Inherited(__a1, __a2) { }
2139 template<
typename _U1,
typename _U2,
2140 _ImplicitCtor<!__is_alloc_arg<_U1>(), _U1, _U2> =
true>
2142 tuple(_U1&& __a1, _U2&& __a2)
2143 noexcept(__nothrow_constructible<_U1, _U2>())
2145 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2147 template<
typename _U1,
typename _U2,
2148 _ExplicitCtor<!__is_alloc_arg<_U1>(), _U1, _U2> =
false>
2150 tuple(_U1&& __a1, _U2&& __a2)
2151 noexcept(__nothrow_constructible<_U1, _U2>())
2153 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2155 constexpr tuple(
const tuple&) =
default;
2157 constexpr tuple(tuple&&) =
default;
2159 template<
typename _U1,
typename _U2,
2160 _ImplicitCtor<true, const _U1&, const _U2&> =
true>
2162 tuple(
const tuple<_U1, _U2>& __in)
2163 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
2164 : _Inherited(
static_cast<const _Tuple_impl<0, _U1, _U2>&
>(__in))
2165 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2167 template<
typename _U1,
typename _U2,
2168 _ExplicitCtor<true, const _U1&, const _U2&> =
false>
2170 tuple(
const tuple<_U1, _U2>& __in)
2171 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
2172 : _Inherited(
static_cast<const _Tuple_impl<0, _U1, _U2>&
>(__in))
2173 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2175 template<
typename _U1,
typename _U2,
2176 _ImplicitCtor<true, _U1, _U2> =
true>
2178 tuple(tuple<_U1, _U2>&& __in)
2179 noexcept(__nothrow_constructible<_U1, _U2>())
2180 : _Inherited(
static_cast<_Tuple_impl<0, _U1, _U2>&&
>(__in))
2181 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2183 template<
typename _U1,
typename _U2,
2184 _ExplicitCtor<true, _U1, _U2> =
false>
2186 tuple(tuple<_U1, _U2>&& __in)
2187 noexcept(__nothrow_constructible<_U1, _U2>())
2188 : _Inherited(
static_cast<_Tuple_impl<0, _U1, _U2>&&
>(__in))
2189 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2191 template<
typename _U1,
typename _U2,
2192 _ImplicitCtor<true, const _U1&, const _U2&> =
true>
2195 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
2196 : _Inherited(__in.first, __in.second)
2197 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2199 template<
typename _U1,
typename _U2,
2200 _ExplicitCtor<true, const _U1&, const _U2&> =
false>
2203 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
2204 : _Inherited(__in.first, __in.second)
2205 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2207 template<
typename _U1,
typename _U2,
2208 _ImplicitCtor<true, _U1, _U2> =
true>
2211 noexcept(__nothrow_constructible<_U1, _U2>())
2214 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2216 template<
typename _U1,
typename _U2,
2217 _ExplicitCtor<true, _U1, _U2> =
false>
2220 noexcept(__nothrow_constructible<_U1, _U2>())
2223 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2227 template<
typename _Alloc,
2228 _ImplicitDefaultCtor<is_object<_Alloc>::value, _T1, _T2> =
true>
2229 _GLIBCXX20_CONSTEXPR
2230 tuple(allocator_arg_t __tag,
const _Alloc& __a)
2231 : _Inherited(__tag, __a) { }
2233 template<
typename _Alloc,
2234 _ExplicitDefaultCtor<is_object<_Alloc>::value, _T1, _T2> =
false>
2235 _GLIBCXX20_CONSTEXPR
2237 tuple(allocator_arg_t __tag,
const _Alloc& __a)
2238 : _Inherited(__tag, __a) { }
2240 template<
typename _Alloc,
bool _Dummy =
true,
2241 _ImplicitCtor<_Dummy, const _T1&, const _T2&> =
true>
2242 _GLIBCXX20_CONSTEXPR
2243 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2244 const _T1& __a1,
const _T2& __a2)
2245 : _Inherited(__tag, __a, __a1, __a2) { }
2247 template<
typename _Alloc,
bool _Dummy =
true,
2248 _ExplicitCtor<_Dummy, const _T1&, const _T2&> =
false>
2250 _GLIBCXX20_CONSTEXPR
2251 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2252 const _T1& __a1,
const _T2& __a2)
2253 : _Inherited(__tag, __a, __a1, __a2) { }
2255 template<
typename _Alloc,
typename _U1,
typename _U2,
2256 _ImplicitCtor<true, _U1, _U2> =
true>
2257 _GLIBCXX20_CONSTEXPR
2258 tuple(allocator_arg_t __tag,
const _Alloc& __a, _U1&& __a1, _U2&& __a2)
2261 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2263 template<
typename _Alloc,
typename _U1,
typename _U2,
2264 _ExplicitCtor<true, _U1, _U2> =
false>
2266 _GLIBCXX20_CONSTEXPR
2267 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2268 _U1&& __a1, _U2&& __a2)
2271 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2273 template<
typename _Alloc>
2274 _GLIBCXX20_CONSTEXPR
2275 tuple(allocator_arg_t __tag,
const _Alloc& __a,
const tuple& __in)
2276 : _Inherited(__tag, __a,
static_cast<const _Inherited&
>(__in)) { }
2278 template<
typename _Alloc>
2279 _GLIBCXX20_CONSTEXPR
2280 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple&& __in)
2281 : _Inherited(__tag, __a,
static_cast<_Inherited&&
>(__in)) { }
2283 template<
typename _Alloc,
typename _U1,
typename _U2,
2284 _ImplicitCtor<true, const _U1&, const _U2&> =
true>
2285 _GLIBCXX20_CONSTEXPR
2286 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2287 const tuple<_U1, _U2>& __in)
2288 : _Inherited(__tag, __a,
2289 static_cast<const _Tuple_impl<0, _U1, _U2>&
>(__in))
2290 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2292 template<
typename _Alloc,
typename _U1,
typename _U2,
2293 _ExplicitCtor<true, const _U1&, const _U2&> =
false>
2295 _GLIBCXX20_CONSTEXPR
2296 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2297 const tuple<_U1, _U2>& __in)
2298 : _Inherited(__tag, __a,
2299 static_cast<const _Tuple_impl<0, _U1, _U2>&
>(__in))
2300 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2302 template<
typename _Alloc,
typename _U1,
typename _U2,
2303 _ImplicitCtor<true, _U1, _U2> =
true>
2304 _GLIBCXX20_CONSTEXPR
2305 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple<_U1, _U2>&& __in)
2306 : _Inherited(__tag, __a,
static_cast<_Tuple_impl<0, _U1, _U2>&&
>(__in))
2307 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2309 template<
typename _Alloc,
typename _U1,
typename _U2,
2310 _ExplicitCtor<true, _U1, _U2> =
false>
2312 _GLIBCXX20_CONSTEXPR
2313 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple<_U1, _U2>&& __in)
2314 : _Inherited(__tag, __a,
static_cast<_Tuple_impl<0, _U1, _U2>&&
>(__in))
2315 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2317 template<
typename _Alloc,
typename _U1,
typename _U2,
2318 _ImplicitCtor<true, const _U1&, const _U2&> =
true>
2319 _GLIBCXX20_CONSTEXPR
2320 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2322 : _Inherited(__tag, __a, __in.first, __in.second)
2323 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2325 template<
typename _Alloc,
typename _U1,
typename _U2,
2326 _ExplicitCtor<true, const _U1&, const _U2&> =
false>
2328 _GLIBCXX20_CONSTEXPR
2329 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2331 : _Inherited(__tag, __a, __in.first, __in.second)
2332 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2334 template<
typename _Alloc,
typename _U1,
typename _U2,
2335 _ImplicitCtor<true, _U1, _U2> =
true>
2336 _GLIBCXX20_CONSTEXPR
2337 tuple(allocator_arg_t __tag,
const _Alloc& __a,
pair<_U1, _U2>&& __in)
2340 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2342 template<
typename _Alloc,
typename _U1,
typename _U2,
2343 _ExplicitCtor<true, _U1, _U2> =
false>
2345 _GLIBCXX20_CONSTEXPR
2346 tuple(allocator_arg_t __tag,
const _Alloc& __a,
pair<_U1, _U2>&& __in)
2349 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2353 _GLIBCXX20_CONSTEXPR
2355 operator=(__conditional_t<__assignable<const _T1&, const _T2&>(),
2357 const __nonesuch&> __in)
2358 noexcept(__nothrow_assignable<const _T1&, const _T2&>())
2360 this->_M_assign(__in);
2364 _GLIBCXX20_CONSTEXPR
2366 operator=(__conditional_t<__assignable<_T1, _T2>(),
2369 noexcept(__nothrow_assignable<_T1, _T2>())
2375 template<
typename _U1,
typename _U2>
2376 _GLIBCXX20_CONSTEXPR
2377 __enable_if_t<__assignable<const _U1&, const _U2&>(), tuple&>
2378 operator=(
const tuple<_U1, _U2>& __in)
2379 noexcept(__nothrow_assignable<const _U1&, const _U2&>())
2381 this->_M_assign(__in);
2385 template<
typename _U1,
typename _U2>
2386 _GLIBCXX20_CONSTEXPR
2387 __enable_if_t<__assignable<_U1, _U2>(), tuple&>
2388 operator=(tuple<_U1, _U2>&& __in)
2389 noexcept(__nothrow_assignable<_U1, _U2>())
2395 template<
typename _U1,
typename _U2>
2396 _GLIBCXX20_CONSTEXPR
2397 __enable_if_t<__assignable<const _U1&, const _U2&>(), tuple&>
2399 noexcept(__nothrow_assignable<const _U1&, const _U2&>())
2401 this->_M_head(*
this) = __in.first;
2402 this->_M_tail(*this)._M_head(*
this) = __in.second;
2406 template<
typename _U1,
typename _U2>
2407 _GLIBCXX20_CONSTEXPR
2408 __enable_if_t<__assignable<_U1, _U2>(), tuple&>
2410 noexcept(__nothrow_assignable<_U1, _U2>())
2417 _GLIBCXX20_CONSTEXPR
2420 noexcept(__and_<__is_nothrow_swappable<_T1>,
2421 __is_nothrow_swappable<_T2>>::value)
2422 { _Inherited::_M_swap(__in); }