Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWG 3158 issue addressed #195

Merged
merged 3 commits into from
Oct 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions stl/inc/tuple
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down