LWG-3158 tuple(allocator_arg_t, const Alloc&) should be conditionally explicit (#195)

Resolves #69.
This commit is contained in:
Nathan Ward 2019-10-22 18:25:38 -06:00 коммит произвёл Stephan T. Lavavej
Родитель f05c358509
Коммит a7d9526804
1 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -419,10 +419,28 @@ public:
: tuple(_Unpack_tuple_t{}, _STD move(_Right)) {}
#endif // ^^^ !_HAS_CONDITIONAL_EXPLICIT ^^^
#if _HAS_CONDITIONAL_EXPLICIT
template <class _Alloc, class _This2 = _This,
enable_if_t<conjunction_v<is_default_constructible<_This2>, is_default_constructible<_Rest>...>, int> = 0>
explicit(
!conjunction_v<_Is_implicitly_default_constructible<_This2>, _Is_implicitly_default_constructible<_Rest>...>)
tuple(allocator_arg_t, const _Alloc& _Al)
: _Mybase(allocator_arg, _Al), _Myfirst(_Al, allocator_arg) {}
#else // ^^^ _HAS_CONDITIONAL_EXPLICIT ^^^ / vvv !_HAS_CONDITIONAL_EXPLICIT vvv
template <class _Alloc, class _This2 = _This,
enable_if_t<conjunction_v<is_default_constructible<_This2>, is_default_constructible<_Rest>...,
_Is_implicitly_default_constructible<_This2>, _Is_implicitly_default_constructible<_Rest>...>,
int> = 0>
tuple(allocator_arg_t, const _Alloc& _Al) : _Mybase(allocator_arg, _Al), _Myfirst(_Al, allocator_arg) {}
template <class _Alloc, class _This2 = _This,
enable_if_t<conjunction_v<is_default_constructible<_This2>, is_default_constructible<_Rest>...,
negation<conjunction<_Is_implicitly_default_constructible<_This2>,
_Is_implicitly_default_constructible<_Rest>...>>>,
int> = 0>
explicit tuple(allocator_arg_t, const _Alloc& _Al) : _Mybase(allocator_arg, _Al), _Myfirst(_Al, allocator_arg) {}
#endif // ^^^ !_HAS_CONDITIONAL_EXPLICIT ^^^
#if _HAS_CONDITIONAL_EXPLICIT
template <class _Alloc, class _This2 = _This,
enable_if_t<_Tuple_constructible_v<tuple, const _This2&, const _Rest&...>, int> = 0>