Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utility

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300644 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-04-19 01:23:39 +00:00
parent 5875c1d527
commit 191f075c6f
3 changed files with 22 additions and 34 deletions

View File

@@ -85,7 +85,7 @@ template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_li
// tuple specializations // tuple specializations
#if !defined(_LIBCPP_HAS_NO_VARIADICS) #ifndef _LIBCPP_CXX03_LANG
template <size_t...> struct __tuple_indices {}; template <size_t...> struct __tuple_indices {};
@@ -189,7 +189,8 @@ template <size_t _Ip, class ..._Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, tuple<_Tp...> >::type&& const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
get(const tuple<_Tp...>&&) _NOEXCEPT; get(const tuple<_Tp...>&&) _NOEXCEPT;
#endif
#endif // !defined(_LIBCPP_CXX03_LANG)
// pair specializations // pair specializations
@@ -205,7 +206,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, pair<_T1, _T2> >::type& const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
get(const pair<_T1, _T2>&) _NOEXCEPT; get(const pair<_T1, _T2>&) _NOEXCEPT;
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) #ifndef _LIBCPP_CXX03_LANG
template <size_t _Ip, class _T1, class _T2> template <size_t _Ip, class _T1, class _T2>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, pair<_T1, _T2> >::type&& typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
@@ -233,7 +234,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _Tp& const _Tp&
get(const array<_Tp, _Size>&) _NOEXCEPT; get(const array<_Tp, _Size>&) _NOEXCEPT;
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) #ifndef _LIBCPP_CXX03_LANG
template <size_t _Ip, class _Tp, size_t _Size> template <size_t _Ip, class _Tp, size_t _Size>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp&& _Tp&&
@@ -245,8 +246,7 @@ const _Tp&&
get(const array<_Tp, _Size>&&) _NOEXCEPT; get(const array<_Tp, _Size>&&) _NOEXCEPT;
#endif #endif
#if !defined(_LIBCPP_HAS_NO_VARIADICS) #ifndef _LIBCPP_CXX03_LANG
// __tuple_types // __tuple_types
@@ -468,9 +468,6 @@ template <size_t _Ip, class ..._Tp>
using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type; using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type;
#endif #endif
#endif // _LIBCPP_HAS_NO_VARIADICS
#ifndef _LIBCPP_CXX03_LANG
template <bool _IsTuple, class _SizeTrait, size_t _Expected> template <bool _IsTuple, class _SizeTrait, size_t _Expected>
struct __tuple_like_with_size_imp : false_type {}; struct __tuple_like_with_size_imp : false_type {};
@@ -495,7 +492,7 @@ struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail {
template <class ...> template <class ...>
static constexpr bool __enable_assign() { return false; } static constexpr bool __enable_assign() { return false; }
}; };
#endif #endif // !defined(_LIBCPP_CXX03_LANG)
#if _LIBCPP_STD_VER > 14 #if _LIBCPP_STD_VER > 14

View File

@@ -148,7 +148,7 @@ template <class... Types>
_LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_VARIADICS #ifndef _LIBCPP_CXX03_LANG
// __tuple_leaf // __tuple_leaf
@@ -1345,9 +1345,6 @@ template <class ..._Tp, class _Alloc>
struct _LIBCPP_TEMPLATE_VIS uses_allocator<tuple<_Tp...>, _Alloc> struct _LIBCPP_TEMPLATE_VIS uses_allocator<tuple<_Tp...>, _Alloc>
: true_type {}; : true_type {};
#endif // _LIBCPP_HAS_NO_VARIADICS
#ifndef _LIBCPP_CXX03_LANG
template <class _T1, class _T2> template <class _T1, class _T2>
template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2> template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
@@ -1358,7 +1355,6 @@ pair<_T1, _T2>::pair(piecewise_construct_t,
second(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...) second(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
{ {
} }
#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14 #if _LIBCPP_STD_VER > 14
template <class _Tp> template <class _Tp>
@@ -1404,6 +1400,8 @@ _LIBCPP_NOEXCEPT_RETURN(
#endif // _LIBCPP_STD_VER > 14 #endif // _LIBCPP_STD_VER > 14
#endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_END_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_TUPLE #endif // _LIBCPP_TUPLE

View File

@@ -272,14 +272,14 @@ swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::v
template <class _Tp> template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_CXX03_LANG
typename conditional typename conditional
< <
!is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value, !is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value,
const _Tp&, const _Tp&,
_Tp&& _Tp&&
>::type >::type
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES #else // _LIBCPP_CXX03_LANG
const _Tp& const _Tp&
#endif #endif
move_if_noexcept(_Tp& __x) _NOEXCEPT move_if_noexcept(_Tp& __x) _NOEXCEPT
@@ -293,7 +293,7 @@ template <class _Tp> void as_const(const _Tp&&) = delete;
#endif #endif
struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { }; struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { };
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY) #if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_UTILITY)
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t(); extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
#else #else
constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
@@ -608,8 +608,7 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
__x.swap(__y); __x.swap(__y);
} }
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_CXX03_LANG
template <class _Tp> template <class _Tp>
struct __make_pair_return_impl struct __make_pair_return_impl
@@ -638,7 +637,7 @@ make_pair(_T1&& __t1, _T2&& __t2)
(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2)); (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
} }
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES #else // _LIBCPP_CXX03_LANG
template <class _T1, class _T2> template <class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
@@ -648,7 +647,7 @@ make_pair(_T1 __x, _T2 __y)
return pair<_T1, _T2>(__x, __y); return pair<_T1, _T2>(__x, __y);
} }
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_CXX03_LANG
template <class _T1, class _T2> template <class _T1, class _T2>
class _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> > class _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> >
@@ -685,8 +684,7 @@ struct __get_pair<0>
const _T1& const _T1&
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;} get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_CXX03_LANG
template <class _T1, class _T2> template <class _T1, class _T2>
static static
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -698,8 +696,7 @@ struct __get_pair<0>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _T1&& const _T1&&
get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);} get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
#endif // _LIBCPP_CXX03_LANG
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}; };
template <> template <>
@@ -717,8 +714,7 @@ struct __get_pair<1>
const _T2& const _T2&
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;} get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_CXX03_LANG
template <class _T1, class _T2> template <class _T1, class _T2>
static static
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -730,8 +726,7 @@ struct __get_pair<1>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _T2&& const _T2&&
get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);} get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
#endif // _LIBCPP_CXX03_LANG
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}; };
template <size_t _Ip, class _T1, class _T2> template <size_t _Ip, class _T1, class _T2>
@@ -750,8 +745,7 @@ get(const pair<_T1, _T2>& __p) _NOEXCEPT
return __get_pair<_Ip>::get(__p); return __get_pair<_Ip>::get(__p);
} }
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_CXX03_LANG
template <size_t _Ip, class _T1, class _T2> template <size_t _Ip, class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, pair<_T1, _T2> >::type&& typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
@@ -767,8 +761,7 @@ get(const pair<_T1, _T2>&& __p) _NOEXCEPT
{ {
return __get_pair<_Ip>::get(_VSTD::move(__p)); return __get_pair<_Ip>::get(_VSTD::move(__p));
} }
#endif // _LIBCPP_CXX03_LANG
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#if _LIBCPP_STD_VER > 11 #if _LIBCPP_STD_VER > 11
template <class _T1, class _T2> template <class _T1, class _T2>