@@ -91,6 +91,12 @@ template <class... _Dests, class... _Srcs>
91
91
_INLINE_VAR constexpr bool _Tuple_assignable_v0<true, tuple<_Dests...>, _Srcs...> =
92
92
conjunction_v<is_assignable<_Dests&, _Srcs>...>; // note _Dests& instead of _Dests
93
93
94
+ #if _HAS_CXX23
95
+ template <class... _Dests, class... _Srcs>
96
+ _INLINE_VAR constexpr bool _Tuple_assignable_v0<true, const tuple<_Dests...>, _Srcs...> =
97
+ conjunction_v<is_assignable<const _Dests&, _Srcs>...>;
98
+ #endif // _HAS_CXX23
99
+
94
100
template <class _Dest, class... _Srcs>
95
101
_INLINE_VAR constexpr bool _Tuple_assignable_v =
96
102
_Tuple_assignable_v0<tuple_size_v<_Dest> == sizeof...(_Srcs), _Dest, _Srcs...>;
@@ -105,27 +111,24 @@ template <class... _Dests, class... _Srcs>
105
111
_INLINE_VAR constexpr bool _Tuple_nothrow_assignable_v0<true, tuple<_Dests...>, _Srcs...> =
106
112
conjunction_v<is_nothrow_assignable<_Dests&, _Srcs>...>; // note _Dests& instead of _Dests
107
113
114
+ #if _HAS_CXX23
115
+ template <class... _Dests, class... _Srcs>
116
+ _INLINE_VAR constexpr bool _Tuple_nothrow_assignable_v0<true, const tuple<_Dests...>, _Srcs...> =
117
+ conjunction_v<is_nothrow_assignable<const _Dests&, _Srcs>...>;
118
+ #endif // _HAS_CXX23
119
+
108
120
template <class _Dest, class... _Srcs>
109
121
_INLINE_VAR constexpr bool _Tuple_nothrow_assignable_v =
110
122
_Tuple_nothrow_assignable_v0<tuple_size_v<_Dest> == sizeof...(_Srcs), _Dest, _Srcs...>;
111
123
112
- // Constrain tuple's copy converting constructor (LWG-2549)
113
- template <class _Myself, class... _Other>
114
- struct _Tuple_convert_copy_val : true_type {};
115
-
116
- template <class _This, class _Uty>
117
- struct _Tuple_convert_copy_val<tuple<_This>, _Uty>
118
- : bool_constant<!disjunction_v<is_same<_This, _Uty>, is_constructible<_This, const tuple<_Uty>&>,
119
- is_convertible<const tuple<_Uty>&, _This>>> {};
120
-
121
- // Constrain tuple's move converting constructor (LWG-2549)
122
- template <class _Myself, class... _Other>
123
- struct _Tuple_convert_move_val : true_type {};
124
+ // Constrain tuple's converting constructors
125
+ template <class _Myself, class _OtherTuple, class... _Other>
126
+ struct _Tuple_convert_val : true_type {};
124
127
125
- template <class _This, class _Uty>
126
- struct _Tuple_convert_move_val <tuple<_This>, _Uty>
127
- : bool_constant<!disjunction_v<is_same<_This, _Uty>, is_constructible<_This, tuple<_Uty> >,
128
- is_convertible<tuple<_Uty> , _This>>> {};
128
+ template <class _This, class _OtherTuple, class _Uty>
129
+ struct _Tuple_convert_val <tuple<_This>, _OtherTuple , _Uty>
130
+ : bool_constant<!disjunction_v<is_same<_This, _Uty>, is_constructible<_This, _OtherTuple >,
131
+ is_convertible<_OtherTuple , _This>>> {};
129
132
130
133
// Constrain tuple's perfect forwarding constructor (LWG-3121)
131
134
template <class _Myself, class _This2, class... _Rest2>
@@ -348,22 +351,22 @@ public:
348
351
349
352
#if _HAS_CONDITIONAL_EXPLICIT
350
353
template <class... _Other, enable_if_t<conjunction_v<_STD _Tuple_constructible_val<tuple, const _Other&...>,
351
- _STD _Tuple_convert_copy_val <tuple, _Other...>>,
354
+ _STD _Tuple_convert_val <tuple, const tuple<_Other...>& , _Other...>>,
352
355
int> = 0>
353
356
constexpr explicit(_Tuple_conditional_explicit_v<tuple, const _Other&...>)
354
357
tuple(const tuple<_Other...>& _Right) noexcept(
355
358
_Tuple_nothrow_constructible_v<tuple, const _Other&...>) // strengthened
356
359
: tuple(_Unpack_tuple_t{}, _Right) {}
357
360
#else // ^^^ _HAS_CONDITIONAL_EXPLICIT ^^^ / vvv !_HAS_CONDITIONAL_EXPLICIT vvv
358
361
template <class... _Other, enable_if_t<conjunction_v<_Tuple_implicit_val<tuple, const _Other&...>,
359
- _Tuple_convert_copy_val <tuple, _Other...>>,
362
+ _Tuple_convert_val <tuple, const tuple<_Other...>& , _Other...>>,
360
363
int> = 0>
361
364
constexpr tuple(const tuple<_Other...>& _Right) noexcept(
362
365
_Tuple_nothrow_constructible_v<tuple, const _Other&...>) // strengthened
363
366
: tuple(_Unpack_tuple_t{}, _Right) {}
364
367
365
368
template <class... _Other, enable_if_t<conjunction_v<_Tuple_explicit_val<tuple, const _Other&...>,
366
- _Tuple_convert_copy_val <tuple, _Other...>>,
369
+ _Tuple_convert_val <tuple, const tuple<_Other...>& , _Other...>>,
367
370
int> = 0>
368
371
constexpr explicit tuple(const tuple<_Other...>& _Right) noexcept(
369
372
_Tuple_nothrow_constructible_v<tuple, const _Other&...>) // strengthened
@@ -372,22 +375,22 @@ public:
372
375
373
376
#if _HAS_CONDITIONAL_EXPLICIT
374
377
template <class... _Other, enable_if_t<conjunction_v<_STD _Tuple_constructible_val<tuple, _Other...>,
375
- _STD _Tuple_convert_move_val <tuple, _Other...>>,
378
+ _STD _Tuple_convert_val <tuple, tuple<_Other...> , _Other...>>,
376
379
int> = 0>
377
380
constexpr explicit(_Tuple_conditional_explicit_v<tuple, _Other...>)
378
381
tuple(tuple<_Other...>&& _Right) noexcept(_Tuple_nothrow_constructible_v<tuple, _Other...>) // strengthened
379
382
: tuple(_Unpack_tuple_t{}, _STD move(_Right)) {}
380
383
#else // ^^^ _HAS_CONDITIONAL_EXPLICIT ^^^ / vvv !_HAS_CONDITIONAL_EXPLICIT vvv
381
- template <class... _Other,
382
- enable_if_t<conjunction_v<_Tuple_implicit_val< tuple, _Other...>, _Tuple_convert_move_val<tuple , _Other...>>,
383
- int> = 0>
384
+ template <class... _Other, enable_if_t<conjunction_v<_Tuple_implicit_val<tuple, _Other...>,
385
+ _Tuple_convert_val< tuple, tuple< _Other...>, _Other...>>,
386
+ int> = 0>
384
387
constexpr tuple(tuple<_Other...>&& _Right) noexcept(
385
388
_Tuple_nothrow_constructible_v<tuple, _Other...>) // strengthened
386
389
: tuple(_Unpack_tuple_t{}, _STD move(_Right)) {}
387
390
388
- template <class... _Other,
389
- enable_if_t<conjunction_v<_Tuple_explicit_val< tuple, _Other...>, _Tuple_convert_move_val<tuple , _Other...>>,
390
- int> = 0>
391
+ template <class... _Other, enable_if_t<conjunction_v<_Tuple_explicit_val<tuple, _Other...>,
392
+ _Tuple_convert_val< tuple, tuple< _Other...>, _Other...>>,
393
+ int> = 0>
391
394
constexpr explicit tuple(tuple<_Other...>&& _Right) noexcept(
392
395
_Tuple_nothrow_constructible_v<tuple, _Other...>) // strengthened
393
396
: tuple(_Unpack_tuple_t{}, _STD move(_Right)) {}
@@ -510,22 +513,22 @@ public:
510
513
#if _HAS_CONDITIONAL_EXPLICIT
511
514
template <class _Alloc, class... _Other,
512
515
enable_if_t<conjunction_v<_STD _Tuple_constructible_val<tuple, const _Other&...>,
513
- _STD _Tuple_convert_copy_val <tuple, _Other...>>,
516
+ _STD _Tuple_convert_val <tuple, const tuple<_Other...>& , _Other...>>,
514
517
int> = 0>
515
518
_CONSTEXPR20 explicit(_Tuple_conditional_explicit_v<tuple, const _Other&...>)
516
519
tuple(allocator_arg_t, const _Alloc& _Al, const tuple<_Other...>& _Right)
517
520
: tuple(_Alloc_unpack_tuple_t{}, _Al, _Right) {}
518
521
#else // ^^^ _HAS_CONDITIONAL_EXPLICIT ^^^ / vvv !_HAS_CONDITIONAL_EXPLICIT vvv
519
522
template <class _Alloc, class... _Other,
520
- enable_if_t<
521
- conjunction_v<_Tuple_implicit_val< tuple, const _Other& ...>, _Tuple_convert_copy_val<tuple , _Other...>>,
523
+ enable_if_t<conjunction_v<_Tuple_implicit_val<tuple, const _Other&...>,
524
+ _Tuple_convert_val< tuple, const tuple< _Other...>& , _Other...>>,
522
525
int> = 0>
523
526
_CONSTEXPR20 tuple(allocator_arg_t, const _Alloc& _Al, const tuple<_Other...>& _Right)
524
527
: tuple(_Alloc_unpack_tuple_t{}, _Al, _Right) {}
525
528
526
529
template <class _Alloc, class... _Other,
527
- enable_if_t<
528
- conjunction_v<_Tuple_explicit_val< tuple, const _Other& ...>, _Tuple_convert_copy_val<tuple , _Other...>>,
530
+ enable_if_t<conjunction_v<_Tuple_explicit_val<tuple, const _Other&...>,
531
+ _Tuple_convert_val< tuple, const tuple< _Other...>& , _Other...>>,
529
532
int> = 0>
530
533
_CONSTEXPR20 explicit tuple(allocator_arg_t, const _Alloc& _Al, const tuple<_Other...>& _Right)
531
534
: tuple(_Alloc_unpack_tuple_t{}, _Al, _Right) {}
@@ -534,20 +537,22 @@ public:
534
537
#if _HAS_CONDITIONAL_EXPLICIT
535
538
template <class _Alloc, class... _Other,
536
539
enable_if_t<conjunction_v<_STD _Tuple_constructible_val<tuple, _Other...>,
537
- _STD _Tuple_convert_move_val <tuple, _Other...>>,
540
+ _STD _Tuple_convert_val <tuple, tuple<_Other...> , _Other...>>,
538
541
int> = 0>
539
542
_CONSTEXPR20 explicit(_Tuple_conditional_explicit_v<tuple, _Other...>)
540
543
tuple(allocator_arg_t, const _Alloc& _Al, tuple<_Other...>&& _Right)
541
544
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right)) {}
542
545
#else // ^^^ _HAS_CONDITIONAL_EXPLICIT ^^^ / vvv !_HAS_CONDITIONAL_EXPLICIT vvv
543
546
template <class _Alloc, class... _Other,
544
- enable_if_t<conjunction_v<_Tuple_implicit_val<tuple, _Other...>, _Tuple_convert_move_val<tuple, _Other...>>,
547
+ enable_if_t<conjunction_v<_Tuple_implicit_val<tuple, _Other...>,
548
+ _Tuple_convert_val<tuple, tuple<_Other...>, _Other...>>,
545
549
int> = 0>
546
550
_CONSTEXPR20 tuple(allocator_arg_t, const _Alloc& _Al, tuple<_Other...>&& _Right)
547
551
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right)) {}
548
552
549
553
template <class _Alloc, class... _Other,
550
- enable_if_t<conjunction_v<_Tuple_explicit_val<tuple, _Other...>, _Tuple_convert_move_val<tuple, _Other...>>,
554
+ enable_if_t<conjunction_v<_Tuple_explicit_val<tuple, _Other...>,
555
+ _Tuple_convert_val<tuple, tuple<_Other...>, _Other...>>,
551
556
int> = 0>
552
557
_CONSTEXPR20 explicit tuple(allocator_arg_t, const _Alloc& _Al, tuple<_Other...>&& _Right)
553
558
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right)) {}
0 commit comments