зеркало из https://github.com/microsoft/STL.git
LWG-3158 tuple(allocator_arg_t, const Alloc&) should be conditionally explicit (#195)
Resolves #69.
This commit is contained in:
Родитель
f05c358509
Коммит
a7d9526804
|
@ -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>
|
||||
|
|
Загрузка…
Ссылка в новой задаче