|
16 | 16 | #include <__fwd/array.h>
|
17 | 17 | #include <__fwd/pair.h>
|
18 | 18 | #include <__fwd/tuple.h>
|
| 19 | +#include <__tuple/sfinae_helpers.h> |
| 20 | +#include <__tuple/tuple_element.h> |
19 | 21 | #include <__tuple/tuple_indices.h>
|
20 | 22 | #include <__tuple/tuple_like_no_subrange.h>
|
21 | 23 | #include <__tuple/tuple_size.h>
|
@@ -128,15 +130,19 @@ struct _LIBCPP_TEMPLATE_VIS pair
|
128 | 130 | }
|
129 | 131 | };
|
130 | 132 |
|
131 |
| - template <bool _Dummy = true, __enable_if_t<_Dummy && _CheckArgs::__enable_default(), int> = 0> |
132 |
| - explicit(!_CheckArgs::__enable_implicit_default()) _LIBCPP_HIDE_FROM_ABI constexpr pair() noexcept( |
| 133 | + template <bool _MaybeEnable> |
| 134 | + using _CheckArgsDep _LIBCPP_NODEBUG = |
| 135 | + typename conditional< _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type; |
| 136 | + |
| 137 | + template <bool _Dummy = true, __enable_if_t<_CheckArgsDep<_Dummy>::__enable_default(), int> = 0> |
| 138 | + explicit(!_CheckArgsDep<_Dummy>::__enable_implicit_default()) _LIBCPP_HIDE_FROM_ABI constexpr pair() noexcept( |
133 | 139 | is_nothrow_default_constructible<first_type>::value && is_nothrow_default_constructible<second_type>::value)
|
134 | 140 | : first(), second() {}
|
135 | 141 |
|
136 |
| - template <bool _Dummy = true, |
137 |
| - __enable_if_t<_Dummy && _CheckArgs::template __is_pair_constructible<_T1 const&, _T2 const&>(), int> = 0> |
| 142 | + template <bool _Dummy = true, |
| 143 | + __enable_if_t<_CheckArgsDep<_Dummy>::template __is_pair_constructible<_T1 const&, _T2 const&>(), int> = 0> |
138 | 144 | _LIBCPP_HIDE_FROM_ABI
|
139 |
| - _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_T1 const&, _T2 const&>()) |
| 145 | + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgsDep<_Dummy>::template __is_implicit<_T1 const&, _T2 const&>()) |
140 | 146 | pair(_T1 const& __t1, _T2 const& __t2) noexcept(is_nothrow_copy_constructible<first_type>::value &&
|
141 | 147 | is_nothrow_copy_constructible<second_type>::value)
|
142 | 148 | : first(__t1), second(__t2) {}
|
|
0 commit comments