@@ -516,6 +516,7 @@ struct __tuple_impl;
516
516
517
517
struct __forward_args {};
518
518
struct __value_init {};
519
+ struct __from_tuple {};
519
520
520
521
template <size_t ... _Indx, class ... _Tp>
521
522
struct _LIBCPP_DECLSPEC_EMPTY_BASES
@@ -538,7 +539,7 @@ struct _LIBCPP_DECLSPEC_EMPTY_BASES
538
539
: __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, _Args>(), __alloc, std::forward<_Args>(__args))... {}
539
540
540
541
template <class _Tuple >
541
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_impl (_Tuple&& __t ) noexcept (
542
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_impl (__from_tuple, _Tuple&& __t ) noexcept (
542
543
(__all<is_nothrow_constructible<
543
544
_Tp,
544
545
typename tuple_element<_Indx, typename __make_tuple_types<_Tuple>::type>::type>::value...>::value))
@@ -547,7 +548,8 @@ struct _LIBCPP_DECLSPEC_EMPTY_BASES
547
548
std::get<_Indx>(__t )))... {}
548
549
549
550
template <class _Alloc , class _Tuple >
550
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_impl (allocator_arg_t , const _Alloc& __a, _Tuple&& __t )
551
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
552
+ __tuple_impl (allocator_arg_t , const _Alloc& __a, __from_tuple, _Tuple&& __t )
551
553
: __tuple_leaf<_Indx, _Tp>(
552
554
__uses_alloc_ctor<_Tp,
553
555
_Alloc,
@@ -673,13 +675,13 @@ public:
673
675
template <class ...> class _And = _And,
674
676
__enable_if_t < _And<is_copy_constructible<_Tp>...>::value, int > = 0 >
675
677
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple (allocator_arg_t , const _Alloc& __alloc, const tuple& __t )
676
- : __base_(allocator_arg_t (), __alloc, __t) {}
678
+ : __base_(allocator_arg_t (), __alloc, __from_tuple(), __t) {}
677
679
678
680
template <class _Alloc ,
679
681
template <class ...> class _And = _And,
680
682
__enable_if_t < _And<is_move_constructible<_Tp>...>::value, int > = 0 >
681
683
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple (allocator_arg_t , const _Alloc& __alloc, tuple&& __t )
682
- : __base_(allocator_arg_t (), __alloc, std::move(__t )) {}
684
+ : __base_(allocator_arg_t (), __alloc, __from_tuple(), std::move(__t )) {}
683
685
684
686
// tuple(const tuple<U...>&) constructors (including allocator_arg_t variants)
685
687
@@ -712,56 +714,56 @@ public:
712
714
_LIBCPP_HIDE_FROM_ABI
713
715
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit (_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)
714
716
tuple(const tuple<_Up...>& __t ) noexcept (_And<is_nothrow_constructible<_Tp, const _Up&>...>::value)
715
- : __base_(__t ) {}
717
+ : __base_(__from_tuple(), __t) {}
716
718
717
719
template <class ... _Up,
718
720
class _Alloc ,
719
721
__enable_if_t < _And< _EnableCtorFromUTypesTuple<const tuple<_Up...>&> >::value, int > = 0 >
720
722
_LIBCPP_HIDE_FROM_ABI
721
723
_LIBCPP_CONSTEXPR_SINCE_CXX20 explicit (_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)
722
724
tuple(allocator_arg_t , const _Alloc& __a, const tuple<_Up...>& __t )
723
- : __base_(allocator_arg_t (), __a, __t) {}
725
+ : __base_(allocator_arg_t (), __a, __from_tuple(), __t) {}
724
726
725
727
# if _LIBCPP_STD_VER >= 23
726
728
// tuple(tuple<U...>&) constructors (including allocator_arg_t variants)
727
729
728
730
template <class ... _Up, enable_if_t < _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr >
729
731
_LIBCPP_HIDE_FROM_ABI constexpr explicit (!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value) tuple(tuple<_Up...>& __t )
730
- : __base_(__t ) {}
732
+ : __base_(__from_tuple(), __t) {}
731
733
732
734
template <class _Alloc , class ... _Up, enable_if_t < _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr >
733
735
_LIBCPP_HIDE_FROM_ABI constexpr explicit (!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value)
734
736
tuple(allocator_arg_t , const _Alloc& __alloc, tuple<_Up...>& __t )
735
- : __base_(allocator_arg_t (), __alloc, __t) {}
737
+ : __base_(allocator_arg_t (), __alloc, __from_tuple(), __t) {}
736
738
# endif // _LIBCPP_STD_VER >= 23
737
739
738
740
// tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)
739
741
template <class ... _Up, __enable_if_t < _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int > = 0 >
740
742
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit (_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
741
743
tuple(tuple<_Up...>&& __t ) noexcept (_And<is_nothrow_constructible<_Tp, _Up>...>::value)
742
- : __base_(std::move(__t )) {}
744
+ : __base_(__from_tuple(), std::move(__t )) {}
743
745
744
746
template <class _Alloc ,
745
747
class ... _Up,
746
748
__enable_if_t < _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int > = 0 >
747
749
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit (_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
748
750
tuple(allocator_arg_t , const _Alloc& __a, tuple<_Up...>&& __t )
749
- : __base_(allocator_arg_t (), __a, std::move(__t )) {}
751
+ : __base_(allocator_arg_t (), __a, __from_tuple(), std::move(__t )) {}
750
752
751
753
# if _LIBCPP_STD_VER >= 23
752
754
// tuple(const tuple<U...>&&) constructors (including allocator_arg_t variants)
753
755
754
756
template <class ... _Up, enable_if_t < _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr >
755
757
_LIBCPP_HIDE_FROM_ABI constexpr explicit (!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)
756
758
tuple(const tuple<_Up...>&& __t )
757
- : __base_(std::move(__t )) {}
759
+ : __base_(__from_tuple(), std::move(__t )) {}
758
760
759
761
template <class _Alloc ,
760
762
class ... _Up,
761
763
enable_if_t < _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr >
762
764
_LIBCPP_HIDE_FROM_ABI constexpr explicit (!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)
763
765
tuple(allocator_arg_t , const _Alloc& __alloc, const tuple<_Up...>&& __t )
764
- : __base_(allocator_arg_t (), __alloc, std::move(__t )) {}
766
+ : __base_(allocator_arg_t (), __alloc, __from_tuple(), std::move(__t )) {}
765
767
# endif // _LIBCPP_STD_VER >= 23
766
768
767
769
// tuple(const pair<U1, U2>&) constructors (including allocator_arg_t variants)
@@ -796,7 +798,7 @@ public:
796
798
_LIBCPP_HIDE_FROM_ABI
797
799
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit (_Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value)
798
800
tuple(const pair<_Up1, _Up2>& __p) noexcept (_NothrowConstructibleFromPair<const pair<_Up1, _Up2>&>::value)
799
- : __base_(__p) {}
801
+ : __base_(__from_tuple(), __p) {}
800
802
801
803
template <class _Alloc ,
802
804
class _Up1 ,
@@ -806,23 +808,23 @@ public:
806
808
_LIBCPP_HIDE_FROM_ABI
807
809
_LIBCPP_CONSTEXPR_SINCE_CXX20 explicit (_Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value)
808
810
tuple(allocator_arg_t , const _Alloc& __a, const pair<_Up1, _Up2>& __p)
809
- : __base_(allocator_arg_t (), __a, __p) {}
811
+ : __base_(allocator_arg_t (), __a, __from_tuple(), __p) {}
810
812
811
813
# if _LIBCPP_STD_VER >= 23
812
814
// tuple(pair<U1, U2>&) constructors (including allocator_arg_t variants)
813
815
814
816
template <class _U1 , class _U2 , enable_if_t < _EnableCtorFromPair<pair<_U1, _U2>&>::value>* = nullptr >
815
817
_LIBCPP_HIDE_FROM_ABI constexpr explicit (!_BothImplicitlyConvertible<pair<_U1, _U2>&>::value)
816
818
tuple(pair<_U1, _U2>& __p)
817
- : __base_(__p) {}
819
+ : __base_(__from_tuple(), __p) {}
818
820
819
821
template <class _Alloc ,
820
822
class _U1 ,
821
823
class _U2 ,
822
824
enable_if_t < _EnableCtorFromPair<std::pair<_U1, _U2>&>::value>* = nullptr >
823
825
_LIBCPP_HIDE_FROM_ABI constexpr explicit (!_BothImplicitlyConvertible<pair<_U1, _U2>&>::value)
824
826
tuple(allocator_arg_t , const _Alloc& __alloc, pair<_U1, _U2>& __p)
825
- : __base_(allocator_arg_t (), __alloc, __p) {}
827
+ : __base_(allocator_arg_t (), __alloc, __from_tuple(), __p) {}
826
828
# endif
827
829
828
830
// tuple(pair<U1, U2>&&) constructors (including allocator_arg_t variants)
@@ -834,7 +836,7 @@ public:
834
836
_LIBCPP_HIDE_FROM_ABI
835
837
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit (_Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value)
836
838
tuple(pair<_Up1, _Up2>&& __p) noexcept (_NothrowConstructibleFromPair<pair<_Up1, _Up2>&&>::value)
837
- : __base_(std::move(__p)) {}
839
+ : __base_(__from_tuple(), std::move(__p)) {}
838
840
839
841
template <class _Alloc ,
840
842
class _Up1 ,
@@ -844,23 +846,23 @@ public:
844
846
_LIBCPP_HIDE_FROM_ABI
845
847
_LIBCPP_CONSTEXPR_SINCE_CXX20 explicit (_Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value)
846
848
tuple(allocator_arg_t , const _Alloc& __a, pair<_Up1, _Up2>&& __p)
847
- : __base_(allocator_arg_t (), __a, std::move(__p)) {}
849
+ : __base_(allocator_arg_t (), __a, __from_tuple(), std::move(__p)) {}
848
850
849
851
# if _LIBCPP_STD_VER >= 23
850
852
// tuple(const pair<U1, U2>&&) constructors (including allocator_arg_t variants)
851
853
852
854
template <class _U1 , class _U2 , enable_if_t < _EnableCtorFromPair<const pair<_U1, _U2>&&>::value>* = nullptr >
853
855
_LIBCPP_HIDE_FROM_ABI constexpr explicit (!_BothImplicitlyConvertible<const pair<_U1, _U2>&&>::value)
854
856
tuple(const pair<_U1, _U2>&& __p)
855
- : __base_(std::move(__p)) {}
857
+ : __base_(__from_tuple(), std::move(__p)) {}
856
858
857
859
template <class _Alloc ,
858
860
class _U1 ,
859
861
class _U2 ,
860
862
enable_if_t < _EnableCtorFromPair<const pair<_U1, _U2>&&>::value>* = nullptr >
861
863
_LIBCPP_HIDE_FROM_ABI constexpr explicit (!_BothImplicitlyConvertible<const pair<_U1, _U2>&&>::value)
862
864
tuple(allocator_arg_t , const _Alloc& __alloc, const pair<_U1, _U2>&& __p)
863
- : __base_(allocator_arg_t (), __alloc, std::move(__p)) {}
865
+ : __base_(allocator_arg_t (), __alloc, __from_tuple(), std::move(__p)) {}
864
866
# endif // _LIBCPP_STD_VER >= 23
865
867
866
868
// [tuple.assign]
0 commit comments