798 class _GLIBCXX_NO_SPECIALIZATIONS tuple
799 :
public _Tuple_impl<0, _Elements...>
801 using _Inherited = _Tuple_impl<0, _Elements...>;
803#if __cpp_concepts && __cpp_consteval && __cpp_conditional_explicit
804 template<
typename... _UTypes>
805 static consteval bool
808 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
814 template<
typename... _UTypes>
815 static consteval bool
816 __nothrow_constructible()
818 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
824 template<
typename... _UTypes>
825 static consteval bool
828 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
829 return __and_v<is_convertible<_UTypes, _Elements>...>;
836 template<
typename... _UTypes>
837 static consteval bool
838 __disambiguating_constraint()
840 if constexpr (
sizeof...(_Elements) !=
sizeof...(_UTypes))
842 else if constexpr (
sizeof...(_Elements) == 1)
844 using _U0 =
typename _Nth_type<0, _UTypes...>::type;
845 return !is_same_v<remove_cvref_t<_U0>, tuple>;
847 else if constexpr (
sizeof...(_Elements) < 4)
849 using _U0 =
typename _Nth_type<0, _UTypes...>::type;
850 if constexpr (!is_same_v<remove_cvref_t<_U0>, allocator_arg_t>)
854 using _T0 =
typename _Nth_type<0, _Elements...>::type;
855 return is_same_v<remove_cvref_t<_T0>, allocator_arg_t>;
864 template<
typename _Tuple>
865 static consteval bool
868 if constexpr (
sizeof...(_Elements) != 1)
870 else if constexpr (is_same_v<remove_cvref_t<_Tuple>, tuple>)
874 using _Tp =
typename _Nth_type<0, _Elements...>::type;
875 if constexpr (is_convertible_v<_Tuple, _Tp>)
877 else if constexpr (is_constructible_v<_Tp, _Tuple>)
883 template<
typename... _Up>
884 static consteval bool
887#if __has_builtin(__reference_constructs_from_temporary)
888 return (__reference_constructs_from_temporary(_Elements, _Up&&)
895#if __cpp_lib_tuple_like
898 template<
typename _UTuple>
899 static consteval bool
900 __dangles_from_tuple_like()
907 template<
typename _UTuple>
908 static consteval bool
909 __constructible_from_tuple_like()
916 template<
typename _UTuple>
917 static consteval bool
918 __convertible_from_tuple_like()
928 explicit(!(__is_implicitly_default_constructible_v<_Elements> && ...))
930 noexcept((is_nothrow_default_constructible_v<_Elements> && ...))
931 requires (is_default_constructible_v<_Elements> && ...)
936 template<
typename =
void>
937 constexpr explicit(!__convertible<
const _Elements&...>())
938 tuple(
const type_identity_t<_Elements>&... __elements)
939 noexcept(__nothrow_constructible<
const _Elements&...>())
940 requires (__constructible<const _Elements&...>())
941 : _Inherited(__elements...)
944 template<
typename... _UTypes>
945 requires (__disambiguating_constraint<_UTypes...>())
946 && (__constructible<_UTypes...>())
947 && (!__dangles<_UTypes...>())
948 constexpr explicit(!__convertible<_UTypes...>())
949 tuple(_UTypes&&... __u)
950 noexcept(__nothrow_constructible<_UTypes...>())
954 template<
typename... _UTypes>
955 requires (__disambiguating_constraint<_UTypes...>())
956 && (__constructible<_UTypes...>())
957 && (__dangles<_UTypes...>())
958 tuple(_UTypes&&...) =
delete;
960 constexpr tuple(
const tuple&) =
default;
963 tuple(tuple&&)
requires (is_move_constructible_v<_Elements> && ...)
966 template<
typename... _UTypes>
967 requires (__constructible<
const _UTypes&...>())
968 && (!__use_other_ctor<
const tuple<_UTypes...>&>())
969 && (!__dangles<
const _UTypes&...>())
970 constexpr explicit(!__convertible<const _UTypes&...>())
971 tuple(
const tuple<_UTypes...>& __u)
972 noexcept(__nothrow_constructible<
const _UTypes&...>())
973 : _Inherited(
static_cast<const _Tuple_impl<0, _UTypes...
>&>(__u))
976 template<
typename... _UTypes>
977 requires (__constructible<
const _UTypes&...>())
978 && (!__use_other_ctor<
const tuple<_UTypes...>&>())
979 && (__dangles<
const _UTypes&...>())
980 tuple(
const tuple<_UTypes...>&) =
delete;
982 template<
typename... _UTypes>
983 requires (__constructible<_UTypes...>())
984 && (!__use_other_ctor<tuple<_UTypes...>>())
985 && (!__dangles<_UTypes...>())
986 constexpr explicit(!__convertible<_UTypes...>())
987 tuple(tuple<_UTypes...>&& __u)
988 noexcept(__nothrow_constructible<_UTypes...>())
989 : _Inherited(
static_cast<_Tuple_impl<0, _UTypes...
>&&>(__u))
992 template<
typename... _UTypes>
993 requires (__constructible<_UTypes...>())
994 && (!__use_other_ctor<tuple<_UTypes...>>())
995 && (__dangles<_UTypes...>())
996 tuple(tuple<_UTypes...>&&) =
delete;
998#if __cpp_lib_ranges_zip
999 template<
typename... _UTypes>
1000 requires (__constructible<_UTypes&...>())
1001 && (!__use_other_ctor<tuple<_UTypes...>&>())
1002 && (!__dangles<_UTypes&...>())
1003 constexpr explicit(!__convertible<_UTypes&...>())
1004 tuple(tuple<_UTypes...>& __u)
1005 noexcept(__nothrow_constructible<_UTypes&...>())
1006 : _Inherited(
static_cast<_Tuple_impl<0, _UTypes...
>&>(__u))
1009 template<
typename... _UTypes>
1010 requires (__constructible<_UTypes&...>())
1011 && (!__use_other_ctor<tuple<_UTypes...>&>())
1012 && (__dangles<_UTypes&...>())
1013 tuple(tuple<_UTypes...>&) =
delete;
1015 template<
typename... _UTypes>
1016 requires (__constructible<
const _UTypes...>())
1017 && (!__use_other_ctor<
const tuple<_UTypes...>>())
1018 && (!__dangles<
const _UTypes...>())
1019 constexpr explicit(!__convertible<const _UTypes...>())
1020 tuple(
const tuple<_UTypes...>&& __u)
1021 noexcept(__nothrow_constructible<
const _UTypes...>())
1022 : _Inherited(
static_cast<const _Tuple_impl<0, _UTypes...
>&&>(__u))
1025 template<
typename... _UTypes>
1026 requires (__constructible<
const _UTypes...>())
1027 && (!__use_other_ctor<
const tuple<_UTypes...>>())
1028 && (__dangles<
const _UTypes...>())
1029 tuple(
const tuple<_UTypes...>&&) =
delete;
1032 template<
typename _U1,
typename _U2>
1033 requires (
sizeof...(_Elements) == 2)
1034 && (__constructible<const _U1&, const _U2&>())
1035 && (!__dangles<const _U1&, const _U2&>())
1036 constexpr explicit(!__convertible<const _U1&, const _U2&>())
1038 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
1039 : _Inherited(__u.first, __u.second)
1042 template<
typename _U1,
typename _U2>
1043 requires (
sizeof...(_Elements) == 2)
1044 && (__constructible<const _U1&, const _U2&>())
1045 && (__dangles<const _U1&, const _U2&>())
1048 template<
typename _U1,
typename _U2>
1049 requires (
sizeof...(_Elements) == 2)
1050 && (__constructible<_U1, _U2>())
1051 && (!__dangles<_U1, _U2>())
1052 constexpr explicit(!__convertible<_U1, _U2>())
1054 noexcept(__nothrow_constructible<_U1, _U2>())
1059 template<
typename _U1,
typename _U2>
1060 requires (
sizeof...(_Elements) == 2)
1061 && (__constructible<_U1, _U2>())
1062 && (__dangles<_U1, _U2>())
1065#if __cpp_lib_ranges_zip
1066 template<
typename _U1,
typename _U2>
1067 requires (
sizeof...(_Elements) == 2)
1068 && (__constructible<_U1&, _U2&>())
1069 && (!__dangles<_U1&, _U2&>())
1070 constexpr explicit(!__convertible<_U1&, _U2&>())
1072 noexcept(__nothrow_constructible<_U1&, _U2&>())
1073 : _Inherited(__u.first, __u.second)
1076 template<
typename _U1,
typename _U2>
1077 requires (
sizeof...(_Elements) == 2)
1078 && (__constructible<_U1&, _U2&>())
1079 && (__dangles<_U1&, _U2&>())
1082 template<
typename _U1,
typename _U2>
1083 requires (
sizeof...(_Elements) == 2)
1084 && (__constructible<const _U1, const _U2>())
1085 && (!__dangles<const _U1, const _U2>())
1086 constexpr explicit(!__convertible<const _U1, const _U2>())
1088 noexcept(__nothrow_constructible<const _U1, const _U2>())
1093 template<
typename _U1,
typename _U2>
1094 requires (
sizeof...(_Elements) == 2)
1095 && (__constructible<const _U1, const _U2>())
1096 && (__dangles<const _U1, const _U2>())
1100#if __cpp_lib_tuple_like
1101 template<__eligible_tuple_like<tuple> _UTuple>
1102 requires (__constructible_from_tuple_like<_UTuple>())
1103 && (!__use_other_ctor<_UTuple>())
1104 && (!__dangles_from_tuple_like<_UTuple>())
1105 constexpr explicit(!__convertible_from_tuple_like<_UTuple>())
1106 tuple(_UTuple&& __u)
1107 : _Inherited(__tuple_like_tag_t{},
1112 template<__eligible_tuple_like<tuple> _UTuple>
1113 requires (__constructible_from_tuple_like<_UTuple>())
1114 && (!__use_other_ctor<_UTuple>())
1115 && (__dangles_from_tuple_like<_UTuple>())
1116 tuple(_UTuple&&) =
delete;
1121 template<
typename _Alloc>
1123 explicit(!(__is_implicitly_default_constructible_v<_Elements> && ...))
1124 tuple(allocator_arg_t __tag,
const _Alloc& __a)
1125 requires (is_default_constructible_v<_Elements> && ...)
1126 : _Inherited(__tag, __a)
1129 template<
typename _Alloc>
1130 constexpr explicit(!__convertible<
const _Elements&...>())
1131 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1132 const type_identity_t<_Elements>&... __elements)
1133 requires (__constructible<
const _Elements&...>())
1134 : _Inherited(__tag, __a, __elements...)
1137 template<
typename _Alloc,
typename... _UTypes>
1138 requires (__disambiguating_constraint<_UTypes...>())
1139 && (__constructible<_UTypes...>())
1140 && (!__dangles<_UTypes...>())
1141 constexpr explicit(!__convertible<_UTypes...>())
1142 tuple(allocator_arg_t __tag,
const _Alloc& __a, _UTypes&&... __u)
1146 template<
typename _Alloc,
typename... _UTypes>
1147 requires (__disambiguating_constraint<_UTypes...>())
1148 && (__constructible<_UTypes...>())
1149 && (__dangles<_UTypes...>())
1150 tuple(allocator_arg_t,
const _Alloc&, _UTypes&&...) =
delete;
1152 template<
typename _Alloc>
1154 tuple(allocator_arg_t __tag,
const _Alloc& __a,
const tuple& __u)
1155 : _Inherited(__tag, __a,
static_cast<const _Inherited&
>(__u))
1158 template<
typename _Alloc>
1159 requires (__constructible<_Elements...>())
1161 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple&& __u)
1162 : _Inherited(__tag, __a,
static_cast<_Inherited&&
>(__u))
1165 template<
typename _Alloc,
typename... _UTypes>
1166 requires (__constructible<
const _UTypes&...>())
1167 && (!__use_other_ctor<
const tuple<_UTypes...>&>())
1168 && (!__dangles<
const _UTypes&...>())
1169 constexpr explicit(!__convertible<const _UTypes&...>())
1170 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1171 const tuple<_UTypes...>& __u)
1172 : _Inherited(__tag, __a,
1173 static_cast<const _Tuple_impl<0, _UTypes...
>&>(__u))
1176 template<
typename _Alloc,
typename... _UTypes>
1177 requires (__constructible<
const _UTypes&...>())
1178 && (!__use_other_ctor<
const tuple<_UTypes...>&>())
1179 && (__dangles<
const _UTypes&...>())
1180 tuple(allocator_arg_t,
const _Alloc&,
const tuple<_UTypes...>&) =
delete;
1182 template<
typename _Alloc,
typename... _UTypes>
1183 requires (__constructible<_UTypes...>())
1184 && (!__use_other_ctor<tuple<_UTypes...>>())
1185 && (!__dangles<_UTypes...>())
1186 constexpr explicit(!__use_other_ctor<tuple<_UTypes...>>())
1187 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple<_UTypes...>&& __u)
1188 : _Inherited(__tag, __a,
static_cast<_Tuple_impl<0, _UTypes...
>&&>(__u))
1191 template<
typename _Alloc,
typename... _UTypes>
1192 requires (__constructible<_UTypes...>())
1193 && (!__use_other_ctor<tuple<_UTypes...>>())
1194 && (__dangles<_UTypes...>())
1195 tuple(allocator_arg_t,
const _Alloc&, tuple<_UTypes...>&&) =
delete;
1197#if __cpp_lib_ranges_zip
1198 template<
typename _Alloc,
typename... _UTypes>
1199 requires (__constructible<_UTypes&...>())
1200 && (!__use_other_ctor<tuple<_UTypes...>&>())
1201 && (!__dangles<_UTypes&...>())
1202 constexpr explicit(!__convertible<_UTypes&...>())
1203 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple<_UTypes...>& __u)
1204 : _Inherited(__tag, __a,
static_cast<_Tuple_impl<0, _UTypes...
>&>(__u))
1207 template<
typename _Alloc,
typename... _UTypes>
1208 requires (__constructible<_UTypes&...>())
1209 && (!__use_other_ctor<tuple<_UTypes...>&>())
1210 && (__dangles<_UTypes&...>())
1211 tuple(allocator_arg_t,
const _Alloc&, tuple<_UTypes...>&) =
delete;
1213 template<
typename _Alloc,
typename... _UTypes>
1214 requires (__constructible<
const _UTypes...>())
1215 && (!__use_other_ctor<
const tuple<_UTypes...>>())
1216 && (!__dangles<
const _UTypes...>())
1217 constexpr explicit(!__convertible<const _UTypes...>())
1218 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1219 const tuple<_UTypes...>&& __u)
1220 : _Inherited(__tag, __a,
1221 static_cast<const _Tuple_impl<0, _UTypes...
>&&>(__u))
1224 template<
typename _Alloc,
typename... _UTypes>
1225 requires (__constructible<
const _UTypes...>())
1226 && (!__use_other_ctor<
const tuple<_UTypes...>>())
1227 && (__dangles<
const _UTypes...>())
1228 tuple(allocator_arg_t,
const _Alloc&,
const tuple<_UTypes...>&&) =
delete;
1231 template<
typename _Alloc,
typename _U1,
typename _U2>
1232 requires (
sizeof...(_Elements) == 2)
1233 && (__constructible<const _U1&, const _U2&>())
1234 && (!__dangles<const _U1&, const _U2&>())
1235 constexpr explicit(!__convertible<const _U1&, const _U2&>())
1236 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1238 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
1239 : _Inherited(__tag, __a, __u.first, __u.second)
1242 template<
typename _Alloc,
typename _U1,
typename _U2>
1243 requires (
sizeof...(_Elements) == 2)
1244 && (__constructible<const _U1&, const _U2&>())
1245 && (__dangles<const _U1&, const _U2&>())
1246 tuple(allocator_arg_t,
const _Alloc&,
const pair<_U1, _U2>&) =
delete;
1248 template<
typename _Alloc,
typename _U1,
typename _U2>
1249 requires (
sizeof...(_Elements) == 2)
1250 && (__constructible<_U1, _U2>())
1251 && (!__dangles<_U1, _U2>())
1252 constexpr explicit(!__convertible<_U1, _U2>())
1253 tuple(allocator_arg_t __tag,
const _Alloc& __a,
pair<_U1, _U2>&& __u)
1254 noexcept(__nothrow_constructible<_U1, _U2>())
1258 template<
typename _Alloc,
typename _U1,
typename _U2>
1259 requires (
sizeof...(_Elements) == 2)
1260 && (__constructible<_U1, _U2>())
1261 && (__dangles<_U1, _U2>())
1262 tuple(allocator_arg_t,
const _Alloc&,
pair<_U1, _U2>&&) =
delete;
1264#if __cpp_lib_ranges_zip
1265 template<
typename _Alloc,
typename _U1,
typename _U2>
1266 requires (
sizeof...(_Elements) == 2)
1267 && (__constructible<_U1&, _U2&>())
1268 && (!__dangles<_U1&, _U2&>())
1269 constexpr explicit(!__convertible<_U1&, _U2&>())
1270 tuple(allocator_arg_t __tag,
const _Alloc& __a,
pair<_U1, _U2>& __u)
1271 noexcept(__nothrow_constructible<_U1&, _U2&>())
1272 : _Inherited(__tag, __a, __u.first, __u.second)
1275 template<
typename _Alloc,
typename _U1,
typename _U2>
1276 requires (
sizeof...(_Elements) == 2)
1277 && (__constructible<_U1&, _U2&>())
1278 && (__dangles<_U1&, _U2&>())
1281 template<
typename _Alloc,
typename _U1,
typename _U2>
1282 requires (
sizeof...(_Elements) == 2)
1283 && (__constructible<const _U1, const _U2>())
1284 && (!__dangles<const _U1, const _U2>())
1285 constexpr explicit(!__convertible<const _U1, const _U2>())
1286 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1288 noexcept(__nothrow_constructible<const _U1, const _U2>())
1292 template<
typename _Alloc,
typename _U1,
typename _U2>
1293 requires (
sizeof...(_Elements) == 2)
1294 && (__constructible<const _U1, const _U2>())
1295 && (__dangles<const _U1, const _U2>())
1296 tuple(allocator_arg_t,
const _Alloc&,
const pair<_U1, _U2>&&) =
delete;
1299#if __cpp_lib_tuple_like
1300 template<
typename _Alloc, __eligible_tuple_like<tuple> _UTuple>
1301 requires (__constructible_from_tuple_like<_UTuple>())
1302 && (!__use_other_ctor<_UTuple>())
1303 && (!__dangles_from_tuple_like<_UTuple>())
1304 constexpr explicit(!__convertible_from_tuple_like<_UTuple>())
1305 tuple(allocator_arg_t __tag,
const _Alloc& __a, _UTuple&& __u)
1306 : _Inherited(__tuple_like_tag_t{},
1311 template<
typename _Alloc, __eligible_tuple_like<tuple> _UTuple>
1312 requires (__constructible_from_tuple_like<_UTuple>())
1313 && (!__use_other_ctor<_UTuple>())
1314 && (__dangles_from_tuple_like<_UTuple>())
1315 tuple(allocator_arg_t,
const _Alloc&, _UTuple&&) =
delete;
1320 template<
bool _Cond>
1321 using _TCC = _TupleConstraints<_Cond, _Elements...>;
1324 template<
bool _Dummy>
1325 using _ImplicitDefaultCtor = __enable_if_t<
1326 _TCC<_Dummy>::__is_implicitly_default_constructible(),
1330 template<
bool _Dummy>
1331 using _ExplicitDefaultCtor = __enable_if_t<
1332 _TCC<_Dummy>::__is_explicitly_default_constructible(),
1336 template<
bool _Cond,
typename... _Args>
1337 using _ImplicitCtor = __enable_if_t<
1338 _TCC<_Cond>::template __is_implicitly_constructible<_Args...>(),
1342 template<
bool _Cond,
typename... _Args>
1343 using _ExplicitCtor = __enable_if_t<
1344 _TCC<_Cond>::template __is_explicitly_constructible<_Args...>(),
1348 template<
typename... _UElements>
1349 static constexpr bool __nothrow_constructible()
1352 __and_<is_nothrow_constructible<_Elements, _UElements>...>::value;
1356 template<
typename _Up>
1357 static constexpr bool __valid_args()
1359 return sizeof...(_Elements) == 1
1360 && !
is_same<tuple, __remove_cvref_t<_Up>>::value;
1364 template<
typename,
typename,
typename... _Tail>
1365 static constexpr bool __valid_args()
1366 {
return (
sizeof...(_Tail) + 2) ==
sizeof...(_Elements); }
1377 template<
typename _Tuple,
typename = tuple,
1378 typename = __remove_cvref_t<_Tuple>>
1379 struct _UseOtherCtor
1384 template<
typename _Tuple,
typename _Tp,
typename _Up>
1385 struct _UseOtherCtor<_Tuple, tuple<_Tp>, tuple<_Up>>
1386 : __or_<is_convertible<_Tuple, _Tp>, is_constructible<_Tp, _Tuple>>::type
1390 template<
typename _Tuple,
typename _Tp>
1391 struct _UseOtherCtor<_Tuple, tuple<_Tp>, tuple<_Tp>>
1398 template<
typename _Tuple>
1399 static constexpr bool __use_other_ctor()
1400 {
return _UseOtherCtor<_Tuple>::value; }
1403#undef __glibcxx_no_dangling_refs
1404#if __has_builtin(__reference_constructs_from_temporary) \
1405 && defined _GLIBCXX_DEBUG
1407# if __cpp_fold_expressions
1408# define __glibcxx_dangling_refs(U) \
1409 (__reference_constructs_from_temporary(_Elements, U) || ...)
1411# define __glibcxx_dangling_refs(U) \
1412 __or_<__bool_constant<__reference_constructs_from_temporary(_Elements, U) \
1415# define __glibcxx_no_dangling_refs(U) \
1416 static_assert(!__glibcxx_dangling_refs(U), \
1417 "std::tuple constructor creates a dangling reference")
1419# define __glibcxx_no_dangling_refs(U)
1424 template<
typename _Dummy = void,
1425 _ImplicitDefaultCtor<is_void<_Dummy>::value> =
true>
1428 noexcept(__and_<is_nothrow_default_constructible<_Elements>...>::value)
1431 template<
typename _Dummy = void,
1432 _ExplicitDefaultCtor<is_void<_Dummy>::value> =
false>
1435 noexcept(__and_<is_nothrow_default_constructible<_Elements>...>::value)
1438 template<
bool _NotEmpty = (
sizeof...(_Elements) >= 1),
1439 _ImplicitCtor<_NotEmpty, const _Elements&...> =
true>
1441 tuple(
const __type_identity_t<_Elements>&... __elements)
1442 noexcept(__nothrow_constructible<
const _Elements&...>())
1443 : _Inherited(__elements...) { }
1445 template<
bool _NotEmpty = (
sizeof...(_Elements) >= 1),
1446 _ExplicitCtor<_NotEmpty, const _Elements&...> =
false>
1448 tuple(
const __type_identity_t<_Elements>&... __elements)
1449 noexcept(__nothrow_constructible<
const _Elements&...>())
1450 : _Inherited(__elements...) { }
1452 template<
typename... _UElements,
1453 bool _Valid = __valid_args<_UElements...>(),
1454 _ImplicitCtor<_Valid, _UElements...> =
true>
1456 tuple(_UElements&&... __elements)
1457 noexcept(__nothrow_constructible<_UElements...>())
1459 { __glibcxx_no_dangling_refs(_UElements&&); }
1461 template<
typename... _UElements,
1462 bool _Valid = __valid_args<_UElements...>(),
1463 _ExplicitCtor<_Valid, _UElements...> =
false>
1465 tuple(_UElements&&... __elements)
1466 noexcept(__nothrow_constructible<_UElements...>())
1468 { __glibcxx_no_dangling_refs(_UElements&&); }
1470 constexpr tuple(
const tuple&) =
default;
1472 constexpr tuple(tuple&&) =
default;
1474 template<
typename... _UElements,
1475 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1476 && !__use_other_ctor<
const tuple<_UElements...>&>(),
1477 _ImplicitCtor<_Valid,
const _UElements&...> =
true>
1479 tuple(
const tuple<_UElements...>& __in)
1480 noexcept(__nothrow_constructible<
const _UElements&...>())
1481 : _Inherited(
static_cast<const _Tuple_impl<0, _UElements...
>&>(__in))
1482 { __glibcxx_no_dangling_refs(
const _UElements&); }
1484 template<
typename... _UElements,
1485 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1486 && !__use_other_ctor<
const tuple<_UElements...>&>(),
1487 _ExplicitCtor<_Valid,
const _UElements&...> =
false>
1489 tuple(
const tuple<_UElements...>& __in)
1490 noexcept(__nothrow_constructible<
const _UElements&...>())
1491 : _Inherited(
static_cast<const _Tuple_impl<0, _UElements...
>&>(__in))
1492 { __glibcxx_no_dangling_refs(
const _UElements&); }
1494 template<
typename... _UElements,
1495 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1496 && !__use_other_ctor<tuple<_UElements...>&&>(),
1497 _ImplicitCtor<_Valid, _UElements...> =
true>
1499 tuple(tuple<_UElements...>&& __in)
1500 noexcept(__nothrow_constructible<_UElements...>())
1501 : _Inherited(
static_cast<_Tuple_impl<0, _UElements...
>&&>(__in))
1502 { __glibcxx_no_dangling_refs(_UElements&&); }
1504 template<
typename... _UElements,
1505 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1506 && !__use_other_ctor<tuple<_UElements...>&&>(),
1507 _ExplicitCtor<_Valid, _UElements...> =
false>
1509 tuple(tuple<_UElements...>&& __in)
1510 noexcept(__nothrow_constructible<_UElements...>())
1511 : _Inherited(
static_cast<_Tuple_impl<0, _UElements...
>&&>(__in))
1512 { __glibcxx_no_dangling_refs(_UElements&&); }
1516 template<
typename _Alloc,
1517 _ImplicitDefaultCtor<is_object<_Alloc>::value> =
true>
1518 _GLIBCXX20_CONSTEXPR
1519 tuple(allocator_arg_t __tag,
const _Alloc& __a)
1520 : _Inherited(__tag, __a) { }
1522 template<
typename _Alloc,
1523 _ExplicitDefaultCtor<is_object<_Alloc>::value> =
false>
1524 _GLIBCXX20_CONSTEXPR
1526 tuple(allocator_arg_t __tag,
const _Alloc& __a)
1527 : _Inherited(__tag, __a) { }
1529 template<
typename _Alloc,
bool _NotEmpty = (
sizeof...(_Elements) >= 1),
1530 _ImplicitCtor<_NotEmpty, const _Elements&...> =
true>
1531 _GLIBCXX20_CONSTEXPR
1532 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1533 const __type_identity_t<_Elements>&... __elements)
1534 : _Inherited(__tag, __a, __elements...) { }
1536 template<
typename _Alloc,
bool _NotEmpty = (
sizeof...(_Elements) >= 1),
1537 _ExplicitCtor<_NotEmpty, const _Elements&...> =
false>
1538 _GLIBCXX20_CONSTEXPR
1540 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1541 const __type_identity_t<_Elements>&... __elements)
1542 : _Inherited(__tag, __a, __elements...) { }
1544 template<
typename _Alloc,
typename... _UElements,
1545 bool _Valid = __valid_args<_UElements...>(),
1546 _ImplicitCtor<_Valid, _UElements...> =
true>
1547 _GLIBCXX20_CONSTEXPR
1548 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1549 _UElements&&... __elements)
1551 { __glibcxx_no_dangling_refs(_UElements&&); }
1553 template<
typename _Alloc,
typename... _UElements,
1554 bool _Valid = __valid_args<_UElements...>(),
1555 _ExplicitCtor<_Valid, _UElements...> =
false>
1556 _GLIBCXX20_CONSTEXPR
1558 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1559 _UElements&&... __elements)
1561 { __glibcxx_no_dangling_refs(_UElements&&); }
1563 template<
typename _Alloc>
1564 _GLIBCXX20_CONSTEXPR
1565 tuple(allocator_arg_t __tag,
const _Alloc& __a,
const tuple& __in)
1566 : _Inherited(__tag, __a,
static_cast<const _Inherited&
>(__in)) { }
1568 template<
typename _Alloc>
1569 _GLIBCXX20_CONSTEXPR
1570 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple&& __in)
1571 : _Inherited(__tag, __a,
static_cast<_Inherited&&
>(__in)) { }
1573 template<
typename _Alloc,
typename... _UElements,
1574 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1575 && !__use_other_ctor<
const tuple<_UElements...>&>(),
1576 _ImplicitCtor<_Valid,
const _UElements&...> =
true>
1577 _GLIBCXX20_CONSTEXPR
1578 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1579 const tuple<_UElements...>& __in)
1580 : _Inherited(__tag, __a,
1581 static_cast<const _Tuple_impl<0, _UElements...
>&>(__in))
1582 { __glibcxx_no_dangling_refs(
const _UElements&); }
1584 template<
typename _Alloc,
typename... _UElements,
1585 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1586 && !__use_other_ctor<
const tuple<_UElements...>&>(),
1587 _ExplicitCtor<_Valid,
const _UElements&...> =
false>
1588 _GLIBCXX20_CONSTEXPR
1590 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1591 const tuple<_UElements...>& __in)
1592 : _Inherited(__tag, __a,
1593 static_cast<const _Tuple_impl<0, _UElements...
>&>(__in))
1594 { __glibcxx_no_dangling_refs(
const _UElements&); }
1596 template<
typename _Alloc,
typename... _UElements,
1597 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1598 && !__use_other_ctor<tuple<_UElements...>&&>(),
1599 _ImplicitCtor<_Valid, _UElements...> =
true>
1600 _GLIBCXX20_CONSTEXPR
1601 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1602 tuple<_UElements...>&& __in)
1603 : _Inherited(__tag, __a,
1604 static_cast<_Tuple_impl<0, _UElements...
>&&>(__in))
1605 { __glibcxx_no_dangling_refs(_UElements&&); }
1607 template<
typename _Alloc,
typename... _UElements,
1608 bool _Valid = (
sizeof...(_Elements) ==
sizeof...(_UElements))
1609 && !__use_other_ctor<tuple<_UElements...>&&>(),
1610 _ExplicitCtor<_Valid, _UElements...> =
false>
1611 _GLIBCXX20_CONSTEXPR
1613 tuple(allocator_arg_t __tag,
const _Alloc& __a,
1614 tuple<_UElements...>&& __in)
1615 : _Inherited(__tag, __a,
1616 static_cast<_Tuple_impl<0, _UElements...
>&&>(__in))
1617 { __glibcxx_no_dangling_refs(_UElements&&); }
1622#if __cpp_concepts && __cpp_consteval
1624 template<
typename... _UTypes>
1625 static consteval bool
1628 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
1634 template<
typename... _UTypes>
1635 static consteval bool
1636 __nothrow_assignable()
1638 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
1644#if __cpp_lib_ranges_zip
1645 template<
typename... _UTypes>
1646 static consteval bool
1647 __const_assignable()
1649 if constexpr (
sizeof...(_UTypes) ==
sizeof...(_Elements))
1656#if __cpp_lib_tuple_like
1657 template<
typename _UTuple>
1658 static consteval bool
1659 __assignable_from_tuple_like()
1666 template<
typename _UTuple>
1667 static consteval bool
1668 __const_assignable_from_tuple_like()
1678 tuple& operator=(
const tuple& __u) =
delete;
1681 operator=(
const tuple& __u)
1682 noexcept(__nothrow_assignable<
const _Elements&...>())
1683 requires (__assignable<const _Elements&...>())
1685 this->_M_assign(__u);
1690 operator=(tuple&& __u)
1691 noexcept(__nothrow_assignable<_Elements...>())
1692 requires (__assignable<_Elements...>())
1698 template<
typename... _UTypes>
1699 requires (__assignable<
const _UTypes&...>())
1701 operator=(
const tuple<_UTypes...>& __u)
1702 noexcept(__nothrow_assignable<
const _UTypes&...>())
1704 this->_M_assign(__u);
1708 template<
typename... _UTypes>
1709 requires (__assignable<_UTypes...>())
1711 operator=(tuple<_UTypes...>&& __u)
1712 noexcept(__nothrow_assignable<_UTypes...>())
1718#if __cpp_lib_ranges_zip
1719 constexpr const tuple&
1720 operator=(
const tuple& __u)
const
1721 requires (__const_assignable<
const _Elements&...>())
1723 this->_M_assign(__u);
1727 constexpr const tuple&
1728 operator=(tuple&& __u)
const
1729 requires (__const_assignable<_Elements...>())
1735 template<
typename... _UTypes>
1736 constexpr const tuple&
1737 operator=(
const tuple<_UTypes...>& __u)
const
1738 requires (__const_assignable<
const _UTypes&...>())
1740 this->_M_assign(__u);
1744 template<
typename... _UTypes>
1745 constexpr const tuple&
1746 operator=(tuple<_UTypes...>&& __u)
const
1747 requires (__const_assignable<_UTypes...>())
1754 template<
typename _U1,
typename _U2>
1755 requires (__assignable<const _U1&, const _U2&>())
1758 noexcept(__nothrow_assignable<const _U1&, const _U2&>())
1760 this->_M_head(*
this) = __u.first;
1761 this->_M_tail(*this)._M_head(*
this) = __u.second;
1765 template<
typename _U1,
typename _U2>
1766 requires (__assignable<_U1, _U2>())
1769 noexcept(__nothrow_assignable<_U1, _U2>())
1776#if __cpp_lib_ranges_zip
1777 template<
typename _U1,
typename _U2>
1778 requires (__const_assignable<const _U1&, const _U2>())
1779 constexpr const tuple&
1782 this->_M_head(*
this) = __u.first;
1783 this->_M_tail(*this)._M_head(*
this) = __u.second;
1787 template<
typename _U1,
typename _U2>
1788 requires (__const_assignable<_U1, _U2>())
1789 constexpr const tuple&
1798#if __cpp_lib_tuple_like
1799 template<__eligible_tuple_like<tuple> _UTuple>
1800 requires (__assignable_from_tuple_like<_UTuple>())
1802 operator=(_UTuple&& __u)
1808 template<__eligible_tuple_like<tuple> _UTuple>
1809 requires (__const_assignable_from_tuple_like<_UTuple>())
1810 constexpr const tuple&
1811 operator=(_UTuple&& __u)
const
1817 template<__tuple_like _UTuple>
1818 requires (!__is_tuple_v<_UTuple>)
1819 friend constexpr bool
1820 operator== [[nodiscard]] (
const tuple& __t,
const _UTuple& __u)
1822 static_assert(
sizeof...(_Elements) == tuple_size_v<_UTuple>,
1823 "tuple objects can only be compared if they have equal sizes.");
1825 return (
bool(std::get<_Is>(__t) == std::get<_Is>(__u))
1830 template<__tuple_like _UTuple,
1832 struct __tuple_like_common_comparison_category;
1834 template<__tuple_like _UTuple,
size_t... _Is>
1836 {
typename void_t<__detail::__synth3way_t<_Elements, tuple_element_t<_Is, _UTuple>>...>; }
1837 struct __tuple_like_common_comparison_category<_UTuple,
index_sequence<_Is...>>
1839 using type = common_comparison_category_t
1840 <__detail::__synth3way_t<_Elements, tuple_element_t<_Is, _UTuple>>...>;
1843 template<__tuple_like _UTuple>
1844 requires (!__is_tuple_v<_UTuple>)
1845 friend constexpr typename __tuple_like_common_comparison_category<_UTuple>::type
1846 operator<=>(
const tuple& __t,
const _UTuple& __u)
1848 using _Cat =
typename __tuple_like_common_comparison_category<_UTuple>::type;
1856 template<
typename... _UElements>
1858 __enable_if_t<
sizeof...(_UElements) ==
sizeof...(_Elements),
bool>
1860 {
return __and_<is_assignable<_Elements&, _UElements>...>::value; }
1863 template<
typename... _UElements>
1864 static constexpr bool __nothrow_assignable()
1867 __and_<is_nothrow_assignable<_Elements&, _UElements>...>::value;
1872 _GLIBCXX20_CONSTEXPR
1874 operator=(__conditional_t<__assignable<const _Elements&...>(),
1876 const __nonesuch&> __in)
1877 noexcept(__nothrow_assignable<
const _Elements&...>())
1879 this->_M_assign(__in);
1883 _GLIBCXX20_CONSTEXPR
1885 operator=(__conditional_t<__assignable<_Elements...>(),
1888 noexcept(__nothrow_assignable<_Elements...>())
1894 template<
typename... _UElements>
1895 _GLIBCXX20_CONSTEXPR
1896 __enable_if_t<__assignable<
const _UElements&...>(), tuple&>
1897 operator=(
const tuple<_UElements...>& __in)
1898 noexcept(__nothrow_assignable<
const _UElements&...>())
1900 this->_M_assign(__in);
1904 template<
typename... _UElements>
1905 _GLIBCXX20_CONSTEXPR
1906 __enable_if_t<__assignable<_UElements...>(), tuple&>
1907 operator=(tuple<_UElements...>&& __in)
1908 noexcept(__nothrow_assignable<_UElements...>())
1916 _GLIBCXX20_CONSTEXPR
1919 noexcept(__and_<__is_nothrow_swappable<_Elements>...>::value)
1920 { _Inherited::_M_swap(__in); }
1922#if __cpp_lib_ranges_zip
1930 swap(
const tuple& __in)
const
1931 noexcept(__and_v<__is_nothrow_swappable<const _Elements>...>)
1932 requires (is_swappable_v<const _Elements> && ...)
1933 { _Inherited::_M_swap(__in); }
2033 class _GLIBCXX_STRUCTURAL tuple<_T1, _T2>
2034 :
public _Tuple_impl<0, _T1, _T2>
2036 typedef _Tuple_impl<0, _T1, _T2> _Inherited;
2039 template<
bool _Dummy,
typename _U1,
typename _U2>
2040 using _ImplicitDefaultCtor = __enable_if_t<
2041 _TupleConstraints<_Dummy, _U1, _U2>::
2042 __is_implicitly_default_constructible(),
2046 template<
bool _Dummy,
typename _U1,
typename _U2>
2047 using _ExplicitDefaultCtor = __enable_if_t<
2048 _TupleConstraints<_Dummy, _U1, _U2>::
2049 __is_explicitly_default_constructible(),
2052 template<
bool _Dummy>
2053 using _TCC = _TupleConstraints<_Dummy, _T1, _T2>;
2056 template<
bool _Cond,
typename _U1,
typename _U2>
2057 using _ImplicitCtor = __enable_if_t<
2058 _TCC<_Cond>::template __is_implicitly_constructible<_U1, _U2>(),
2062 template<
bool _Cond,
typename _U1,
typename _U2>
2063 using _ExplicitCtor = __enable_if_t<
2064 _TCC<_Cond>::template __is_explicitly_constructible<_U1, _U2>(),
2067 template<
typename _U1,
typename _U2>
2068 static constexpr bool __assignable()
2070 return __and_<is_assignable<_T1&, _U1>,
2074 template<
typename _U1,
typename _U2>
2075 static constexpr bool __nothrow_assignable()
2077 return __and_<is_nothrow_assignable<_T1&, _U1>,
2081 template<
typename _U1,
typename _U2>
2082 static constexpr bool __nothrow_constructible()
2084 return __and_<is_nothrow_constructible<_T1, _U1>,
2088 static constexpr bool __nothrow_default_constructible()
2090 return __and_<is_nothrow_default_constructible<_T1>,
2094 template<
typename _U1>
2095 static constexpr bool __is_alloc_arg()
2099#undef __glibcxx_no_dangling_refs
2101#if __has_builtin(__reference_constructs_from_temporary)
2102# define __glibcxx_no_dangling_refs(_U1, _U2) \
2103 static_assert(!__reference_constructs_from_temporary(_T1, _U1) \
2104 && !__reference_constructs_from_temporary(_T2, _U2), \
2105 "std::tuple constructor creates a dangling reference")
2107# define __glibcxx_no_dangling_refs(_U1, _U2)
2112 template<
bool _Dummy =
true,
2113 _ImplicitDefaultCtor<_Dummy, _T1, _T2> =
true>
2116 noexcept(__nothrow_default_constructible())
2119 template<
bool _Dummy =
true,
2120 _ExplicitDefaultCtor<_Dummy, _T1, _T2> =
false>
2123 noexcept(__nothrow_default_constructible())
2126 template<
bool _Dummy =
true,
2127 _ImplicitCtor<_Dummy, const _T1&, const _T2&> =
true>
2129 tuple(
const _T1& __a1,
const _T2& __a2)
2130 noexcept(__nothrow_constructible<const _T1&, const _T2&>())
2131 : _Inherited(__a1, __a2) { }
2133 template<
bool _Dummy =
true,
2134 _ExplicitCtor<_Dummy, const _T1&, const _T2&> =
false>
2136 tuple(
const _T1& __a1,
const _T2& __a2)
2137 noexcept(__nothrow_constructible<const _T1&, const _T2&>())
2138 : _Inherited(__a1, __a2) { }
2140 template<
typename _U1,
typename _U2,
2141 _ImplicitCtor<!__is_alloc_arg<_U1>(), _U1, _U2> =
true>
2143 tuple(_U1&& __a1, _U2&& __a2)
2144 noexcept(__nothrow_constructible<_U1, _U2>())
2146 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2148 template<
typename _U1,
typename _U2,
2149 _ExplicitCtor<!__is_alloc_arg<_U1>(), _U1, _U2> =
false>
2151 tuple(_U1&& __a1, _U2&& __a2)
2152 noexcept(__nothrow_constructible<_U1, _U2>())
2154 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2156 constexpr tuple(
const tuple&) =
default;
2158 constexpr tuple(tuple&&) =
default;
2160 template<
typename _U1,
typename _U2,
2161 _ImplicitCtor<true, const _U1&, const _U2&> =
true>
2163 tuple(
const tuple<_U1, _U2>& __in)
2164 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
2165 : _Inherited(
static_cast<const _Tuple_impl<0, _U1, _U2>&
>(__in))
2166 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2168 template<
typename _U1,
typename _U2,
2169 _ExplicitCtor<true, const _U1&, const _U2&> =
false>
2171 tuple(
const tuple<_U1, _U2>& __in)
2172 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
2173 : _Inherited(
static_cast<const _Tuple_impl<0, _U1, _U2>&
>(__in))
2174 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2176 template<
typename _U1,
typename _U2,
2177 _ImplicitCtor<true, _U1, _U2> =
true>
2179 tuple(tuple<_U1, _U2>&& __in)
2180 noexcept(__nothrow_constructible<_U1, _U2>())
2181 : _Inherited(
static_cast<_Tuple_impl<0, _U1, _U2>&&
>(__in))
2182 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2184 template<
typename _U1,
typename _U2,
2185 _ExplicitCtor<true, _U1, _U2> =
false>
2187 tuple(tuple<_U1, _U2>&& __in)
2188 noexcept(__nothrow_constructible<_U1, _U2>())
2189 : _Inherited(
static_cast<_Tuple_impl<0, _U1, _U2>&&
>(__in))
2190 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2192 template<
typename _U1,
typename _U2,
2193 _ImplicitCtor<true, const _U1&, const _U2&> =
true>
2196 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
2197 : _Inherited(__in.first, __in.second)
2198 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2200 template<
typename _U1,
typename _U2,
2201 _ExplicitCtor<true, const _U1&, const _U2&> =
false>
2204 noexcept(__nothrow_constructible<const _U1&, const _U2&>())
2205 : _Inherited(__in.first, __in.second)
2206 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2208 template<
typename _U1,
typename _U2,
2209 _ImplicitCtor<true, _U1, _U2> =
true>
2212 noexcept(__nothrow_constructible<_U1, _U2>())
2215 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2217 template<
typename _U1,
typename _U2,
2218 _ExplicitCtor<true, _U1, _U2> =
false>
2221 noexcept(__nothrow_constructible<_U1, _U2>())
2224 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2228 template<
typename _Alloc,
2229 _ImplicitDefaultCtor<is_object<_Alloc>::value, _T1, _T2> =
true>
2230 _GLIBCXX20_CONSTEXPR
2231 tuple(allocator_arg_t __tag,
const _Alloc& __a)
2232 : _Inherited(__tag, __a) { }
2234 template<
typename _Alloc,
2235 _ExplicitDefaultCtor<is_object<_Alloc>::value, _T1, _T2> =
false>
2236 _GLIBCXX20_CONSTEXPR
2238 tuple(allocator_arg_t __tag,
const _Alloc& __a)
2239 : _Inherited(__tag, __a) { }
2241 template<
typename _Alloc,
bool _Dummy =
true,
2242 _ImplicitCtor<_Dummy, const _T1&, const _T2&> =
true>
2243 _GLIBCXX20_CONSTEXPR
2244 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2245 const _T1& __a1,
const _T2& __a2)
2246 : _Inherited(__tag, __a, __a1, __a2) { }
2248 template<
typename _Alloc,
bool _Dummy =
true,
2249 _ExplicitCtor<_Dummy, const _T1&, const _T2&> =
false>
2251 _GLIBCXX20_CONSTEXPR
2252 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2253 const _T1& __a1,
const _T2& __a2)
2254 : _Inherited(__tag, __a, __a1, __a2) { }
2256 template<
typename _Alloc,
typename _U1,
typename _U2,
2257 _ImplicitCtor<true, _U1, _U2> =
true>
2258 _GLIBCXX20_CONSTEXPR
2259 tuple(allocator_arg_t __tag,
const _Alloc& __a, _U1&& __a1, _U2&& __a2)
2262 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2264 template<
typename _Alloc,
typename _U1,
typename _U2,
2265 _ExplicitCtor<true, _U1, _U2> =
false>
2267 _GLIBCXX20_CONSTEXPR
2268 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2269 _U1&& __a1, _U2&& __a2)
2272 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2274 template<
typename _Alloc>
2275 _GLIBCXX20_CONSTEXPR
2276 tuple(allocator_arg_t __tag,
const _Alloc& __a,
const tuple& __in)
2277 : _Inherited(__tag, __a,
static_cast<const _Inherited&
>(__in)) { }
2279 template<
typename _Alloc>
2280 _GLIBCXX20_CONSTEXPR
2281 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple&& __in)
2282 : _Inherited(__tag, __a,
static_cast<_Inherited&&
>(__in)) { }
2284 template<
typename _Alloc,
typename _U1,
typename _U2,
2285 _ImplicitCtor<true, const _U1&, const _U2&> =
true>
2286 _GLIBCXX20_CONSTEXPR
2287 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2288 const tuple<_U1, _U2>& __in)
2289 : _Inherited(__tag, __a,
2290 static_cast<const _Tuple_impl<0, _U1, _U2>&
>(__in))
2291 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2293 template<
typename _Alloc,
typename _U1,
typename _U2,
2294 _ExplicitCtor<true, const _U1&, const _U2&> =
false>
2296 _GLIBCXX20_CONSTEXPR
2297 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2298 const tuple<_U1, _U2>& __in)
2299 : _Inherited(__tag, __a,
2300 static_cast<const _Tuple_impl<0, _U1, _U2>&
>(__in))
2301 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2303 template<
typename _Alloc,
typename _U1,
typename _U2,
2304 _ImplicitCtor<true, _U1, _U2> =
true>
2305 _GLIBCXX20_CONSTEXPR
2306 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple<_U1, _U2>&& __in)
2307 : _Inherited(__tag, __a,
static_cast<_Tuple_impl<0, _U1, _U2>&&
>(__in))
2308 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2310 template<
typename _Alloc,
typename _U1,
typename _U2,
2311 _ExplicitCtor<true, _U1, _U2> =
false>
2313 _GLIBCXX20_CONSTEXPR
2314 tuple(allocator_arg_t __tag,
const _Alloc& __a, tuple<_U1, _U2>&& __in)
2315 : _Inherited(__tag, __a,
static_cast<_Tuple_impl<0, _U1, _U2>&&
>(__in))
2316 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2318 template<
typename _Alloc,
typename _U1,
typename _U2,
2319 _ImplicitCtor<true, const _U1&, const _U2&> =
true>
2320 _GLIBCXX20_CONSTEXPR
2321 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2323 : _Inherited(__tag, __a, __in.first, __in.second)
2324 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2326 template<
typename _Alloc,
typename _U1,
typename _U2,
2327 _ExplicitCtor<true, const _U1&, const _U2&> =
false>
2329 _GLIBCXX20_CONSTEXPR
2330 tuple(allocator_arg_t __tag,
const _Alloc& __a,
2332 : _Inherited(__tag, __a, __in.first, __in.second)
2333 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
2335 template<
typename _Alloc,
typename _U1,
typename _U2,
2336 _ImplicitCtor<true, _U1, _U2> =
true>
2337 _GLIBCXX20_CONSTEXPR
2338 tuple(allocator_arg_t __tag,
const _Alloc& __a,
pair<_U1, _U2>&& __in)
2341 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2343 template<
typename _Alloc,
typename _U1,
typename _U2,
2344 _ExplicitCtor<true, _U1, _U2> =
false>
2346 _GLIBCXX20_CONSTEXPR
2347 tuple(allocator_arg_t __tag,
const _Alloc& __a,
pair<_U1, _U2>&& __in)
2350 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
2354 _GLIBCXX20_CONSTEXPR
2356 operator=(__conditional_t<__assignable<const _T1&, const _T2&>(),
2358 const __nonesuch&> __in)
2359 noexcept(__nothrow_assignable<const _T1&, const _T2&>())
2361 this->_M_assign(__in);
2365 _GLIBCXX20_CONSTEXPR
2367 operator=(__conditional_t<__assignable<_T1, _T2>(),
2370 noexcept(__nothrow_assignable<_T1, _T2>())
2376 template<
typename _U1,
typename _U2>
2377 _GLIBCXX20_CONSTEXPR
2378 __enable_if_t<__assignable<const _U1&, const _U2&>(), tuple&>
2379 operator=(
const tuple<_U1, _U2>& __in)
2380 noexcept(__nothrow_assignable<const _U1&, const _U2&>())
2382 this->_M_assign(__in);
2386 template<
typename _U1,
typename _U2>
2387 _GLIBCXX20_CONSTEXPR
2388 __enable_if_t<__assignable<_U1, _U2>(), tuple&>
2389 operator=(tuple<_U1, _U2>&& __in)
2390 noexcept(__nothrow_assignable<_U1, _U2>())
2396 template<
typename _U1,
typename _U2>
2397 _GLIBCXX20_CONSTEXPR
2398 __enable_if_t<__assignable<const _U1&, const _U2&>(), tuple&>
2400 noexcept(__nothrow_assignable<const _U1&, const _U2&>())
2402 this->_M_head(*
this) = __in.first;
2403 this->_M_tail(*this)._M_head(*
this) = __in.second;
2407 template<
typename _U1,
typename _U2>
2408 _GLIBCXX20_CONSTEXPR
2409 __enable_if_t<__assignable<_U1, _U2>(), tuple&>
2411 noexcept(__nothrow_assignable<_U1, _U2>())
2418 _GLIBCXX20_CONSTEXPR
2421 noexcept(__and_<__is_nothrow_swappable<_T1>,
2422 __is_nothrow_swappable<_T2>>::value)
2423 { _Inherited::_M_swap(__in); }