As a conforming extension give tuple a noexcept default constructor conditionalized on its held types.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@159858 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5394c1ed30
commit
4eebfc3394
@ -227,7 +227,8 @@ class __tuple_leaf
|
|||||||
|
|
||||||
__tuple_leaf& operator=(const __tuple_leaf&);
|
__tuple_leaf& operator=(const __tuple_leaf&);
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf() : value()
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
|
||||||
|
_NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) : value()
|
||||||
{static_assert(!is_reference<_Hp>::value,
|
{static_assert(!is_reference<_Hp>::value,
|
||||||
"Attempted to default construct a reference element in a tuple");}
|
"Attempted to default construct a reference element in a tuple");}
|
||||||
|
|
||||||
@ -347,7 +348,8 @@ class __tuple_leaf<_Ip, _Hp, true>
|
|||||||
|
|
||||||
__tuple_leaf& operator=(const __tuple_leaf&);
|
__tuple_leaf& operator=(const __tuple_leaf&);
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf() {}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
|
||||||
|
_NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) {}
|
||||||
|
|
||||||
template <class _Alloc>
|
template <class _Alloc>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -437,7 +439,8 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
|||||||
: public __tuple_leaf<_Indx, _Tp>...
|
: public __tuple_leaf<_Indx, _Tp>...
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_CONSTEXPR __tuple_impl() {}
|
_LIBCPP_CONSTEXPR __tuple_impl()
|
||||||
|
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
|
||||||
|
|
||||||
template <size_t ..._Uf, class ..._Tf,
|
template <size_t ..._Uf, class ..._Tf,
|
||||||
size_t ..._Ul, class ..._Tl, class ..._Up>
|
size_t ..._Ul, class ..._Tl, class ..._Up>
|
||||||
@ -535,7 +538,8 @@ class _LIBCPP_VISIBLE tuple
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_CONSTEXPR tuple() {}
|
_LIBCPP_CONSTEXPR tuple()
|
||||||
|
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit tuple(const _Tp& ... __t)
|
explicit tuple(const _Tp& ... __t)
|
||||||
@ -693,7 +697,7 @@ class _LIBCPP_VISIBLE tuple<>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_CONSTEXPR tuple() {}
|
_LIBCPP_CONSTEXPR tuple() _NOEXCEPT {}
|
||||||
template <class _Alloc>
|
template <class _Alloc>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
tuple(allocator_arg_t, const _Alloc&) {}
|
tuple(allocator_arg_t, const _Alloc&) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user