summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-07-06 20:50:27 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-07-06 20:50:27 +0000
commita0f4c45c38455b655bdb46737c05dae3efe38591 (patch)
treef603f5e0fc4a08d29dd9f7769818804145d13228 /libcxx/include
parenta62ebe043e3d9364a7b55e05a123bbadd8cfbd99 (diff)
downloadbcm5719-llvm-a0f4c45c38455b655bdb46737c05dae3efe38591.tar.gz
bcm5719-llvm-a0f4c45c38455b655bdb46737c05dae3efe38591.zip
As a conforming extension give tuple a noexcept default constructor conditionalized on its held types.
llvm-svn: 159858
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/tuple14
1 files changed, 9 insertions, 5 deletions
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index a485d7d1d80..7f34baba4c4 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -227,7 +227,8 @@ class __tuple_leaf
__tuple_leaf& operator=(const __tuple_leaf&);
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,
"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&);
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>
_LIBCPP_INLINE_VISIBILITY
@@ -437,7 +439,8 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
: public __tuple_leaf<_Indx, _Tp>...
{
_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,
size_t ..._Ul, class ..._Tl, class ..._Up>
@@ -535,7 +538,8 @@ class _LIBCPP_VISIBLE tuple
public:
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR tuple() {}
+ _LIBCPP_CONSTEXPR tuple()
+ _NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
_LIBCPP_INLINE_VISIBILITY
explicit tuple(const _Tp& ... __t)
@@ -693,7 +697,7 @@ class _LIBCPP_VISIBLE tuple<>
{
public:
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR tuple() {}
+ _LIBCPP_CONSTEXPR tuple() _NOEXCEPT {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc&) {}
OpenPOWER on IntegriCloud