|
@@ -19,7 +19,7 @@ namespace std
|
|
|
template <class... T>
|
|
|
class tuple {
|
|
|
public:
|
|
|
- explicit(see-below) constexpr tuple();
|
|
|
+ constexpr tuple();
|
|
|
explicit(see-below) tuple(const T&...); // constexpr in C++14
|
|
|
template <class... U>
|
|
|
explicit(see-below) tuple(U&&...); // constexpr in C++14
|
|
@@ -500,22 +500,9 @@ class _LIBCPP_TEMPLATE_VIS tuple
|
|
|
struct _CheckArgsConstructor<true, _Dummy>
|
|
|
{
|
|
|
template <class ..._Args>
|
|
|
- struct __enable_implicit_default
|
|
|
- // In C++03, there's no way to implement the resolution of LWG2510.
|
|
|
-#ifdef _LIBCPP_CXX03_LANG
|
|
|
- : true_type
|
|
|
-#else
|
|
|
- : __all<__is_implicitly_default_constructible<_Args>::value...>
|
|
|
-#endif
|
|
|
- { };
|
|
|
-
|
|
|
- template <class ..._Args>
|
|
|
- struct __enable_explicit_default
|
|
|
- : integral_constant<bool,
|
|
|
- __all<is_default_constructible<_Args>::value...>::value &&
|
|
|
- !__enable_implicit_default<_Args...>::value
|
|
|
- >
|
|
|
- { };
|
|
|
+ static constexpr bool __enable_default() {
|
|
|
+ return __all<is_default_constructible<_Args>::value...>::value;
|
|
|
+ }
|
|
|
|
|
|
template <class ..._Args>
|
|
|
static constexpr bool __enable_explicit() {
|
|
@@ -654,29 +641,22 @@ class _LIBCPP_TEMPLATE_VIS tuple
|
|
|
const typename tuple_element<_Jp, tuple<_Up...> >::type&& get(const tuple<_Up...>&&) _NOEXCEPT;
|
|
|
public:
|
|
|
|
|
|
- template <bool _Dummy = true, _EnableIf<
|
|
|
- _CheckArgsConstructor<_Dummy>::template __enable_implicit_default<_Tp...>::value
|
|
|
- , void*> = nullptr>
|
|
|
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
|
|
- tuple()
|
|
|
- _NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
|
|
|
-
|
|
|
- template <bool _Dummy = true, _EnableIf<
|
|
|
- _CheckArgsConstructor<_Dummy>::template __enable_explicit_default<_Tp...>::value
|
|
|
- , void*> = nullptr>
|
|
|
- explicit _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
|
|
- tuple()
|
|
|
+ template <bool _Dummy = true, class = typename enable_if<
|
|
|
+ _CheckArgsConstructor<_Dummy>::template __enable_default<_Tp...>()
|
|
|
+ >::type>
|
|
|
+ _LIBCPP_INLINE_VISIBILITY
|
|
|
+ _LIBCPP_CONSTEXPR tuple()
|
|
|
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
|
|
|
|
|
|
tuple(tuple const&) = default;
|
|
|
tuple(tuple&&) = default;
|
|
|
|
|
|
- template <class _AllocArgT, class _Alloc, bool _Dummy = true, _EnableIf<
|
|
|
+ template <class _AllocArgT, class _Alloc, bool _Dummy = true, class = _EnableIf<
|
|
|
_And<
|
|
|
_IsSame<allocator_arg_t, _AllocArgT>,
|
|
|
- typename _CheckArgsConstructor<_Dummy>::template __enable_implicit_default<_Tp...>
|
|
|
+ __dependent_type<is_default_constructible<_Tp>, _Dummy>...
|
|
|
>::value
|
|
|
- , void*> = nullptr
|
|
|
+ >
|
|
|
>
|
|
|
_LIBCPP_INLINE_VISIBILITY
|
|
|
tuple(_AllocArgT, _Alloc const& __a)
|
|
@@ -685,20 +665,6 @@ public:
|
|
|
typename __make_tuple_indices<sizeof...(_Tp), 0>::type(),
|
|
|
__tuple_types<_Tp...>()) {}
|
|
|
|
|
|
- template <class _AllocArgT, class _Alloc, bool _Dummy = true, _EnableIf<
|
|
|
- _And<
|
|
|
- _IsSame<allocator_arg_t, _AllocArgT>,
|
|
|
- typename _CheckArgsConstructor<_Dummy>::template __enable_explicit_default<_Tp...>
|
|
|
- >::value
|
|
|
- , void*> = nullptr
|
|
|
- >
|
|
|
- explicit _LIBCPP_INLINE_VISIBILITY
|
|
|
- tuple(_AllocArgT, _Alloc const& __a)
|
|
|
- : __base_(allocator_arg_t(), __a,
|
|
|
- __tuple_indices<>(), __tuple_types<>(),
|
|
|
- typename __make_tuple_indices<sizeof...(_Tp), 0>::type(),
|
|
|
- __tuple_types<_Tp...>()) {}
|
|
|
-
|
|
|
template <bool _Dummy = true,
|
|
|
typename enable_if
|
|
|
<
|