summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-04-19 01:23:39 +0000
committerEric Fiselier <eric@efcs.ca>2017-04-19 01:23:39 +0000
commit191f075c6fe7440659781f2603088b2df337c06a (patch)
tree6920aa6e8179410800f665839b9285cdf274a8f8 /include
parent5875c1d527fdf7ed6a272c1cc30d81c8bab880ed (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/__tuple17
-rw-r--r--include/tuple8
-rw-r--r--include/utility31
3 files changed, 22 insertions, 34 deletions
diff --git a/include/__tuple b/include/__tuple
index 4193d2cff..69d6ee961 100644
--- a/include/__tuple
+++ b/include/__tuple
@@ -85,7 +85,7 @@ template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_li
// tuple specializations
-#if !defined(_LIBCPP_HAS_NO_VARIADICS)
+#ifndef _LIBCPP_CXX03_LANG
template <size_t...> struct __tuple_indices {};
@@ -189,7 +189,8 @@ template <size_t _Ip, class ..._Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
get(const tuple<_Tp...>&&) _NOEXCEPT;
-#endif
+
+#endif // !defined(_LIBCPP_CXX03_LANG)
// pair specializations
@@ -205,7 +206,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
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>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
@@ -233,7 +234,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _Tp&
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>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp&&
@@ -245,8 +246,7 @@ const _Tp&&
get(const array<_Tp, _Size>&&) _NOEXCEPT;
#endif
-#if !defined(_LIBCPP_HAS_NO_VARIADICS)
-
+#ifndef _LIBCPP_CXX03_LANG
// __tuple_types
@@ -468,9 +468,6 @@ template <size_t _Ip, class ..._Tp>
using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type;
#endif
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-#ifndef _LIBCPP_CXX03_LANG
template <bool _IsTuple, class _SizeTrait, size_t _Expected>
struct __tuple_like_with_size_imp : false_type {};
@@ -495,7 +492,7 @@ struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail {
template <class ...>
static constexpr bool __enable_assign() { return false; }
};
-#endif
+#endif // !defined(_LIBCPP_CXX03_LANG)
#if _LIBCPP_STD_VER > 14
diff --git a/include/tuple b/include/tuple
index f2a747219..b869b861c 100644
--- a/include/tuple
+++ b/include/tuple
@@ -148,7 +148,7 @@ template <class... Types>
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
// __tuple_leaf
@@ -1345,9 +1345,6 @@ template <class ..._Tp, class _Alloc>
struct _LIBCPP_TEMPLATE_VIS uses_allocator<tuple<_Tp...>, _Alloc>
: true_type {};
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-#ifndef _LIBCPP_CXX03_LANG
template <class _T1, class _T2>
template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1358,7 +1355,6 @@ pair<_T1, _T2>::pair(piecewise_construct_t,
second(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
{
}
-#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14
template <class _Tp>
@@ -1404,6 +1400,8 @@ _LIBCPP_NOEXCEPT_RETURN(
#endif // _LIBCPP_STD_VER > 14
+#endif // !defined(_LIBCPP_CXX03_LANG)
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_TUPLE
diff --git a/include/utility b/include/utility
index 1f41c0771..fffa35df8 100644
--- a/include/utility
+++ b/include/utility
@@ -272,14 +272,14 @@ swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::v
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
typename conditional
<
!is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value,
const _Tp&,
_Tp&&
>::type
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else // _LIBCPP_CXX03_LANG
const _Tp&
#endif
move_if_noexcept(_Tp& __x) _NOEXCEPT
@@ -293,7 +293,7 @@ template <class _Tp> void as_const(const _Tp&&) = delete;
#endif
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();
#else
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);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
struct __make_pair_return_impl
@@ -638,7 +637,7 @@ make_pair(_T1&& __t1, _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>
inline _LIBCPP_INLINE_VISIBILITY
@@ -648,7 +647,7 @@ make_pair(_T1 __x, _T2 __y)
return pair<_T1, _T2>(__x, __y);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _T1, class _T2>
class _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> >
@@ -685,8 +684,7 @@ struct __get_pair<0>
const _T1&
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>
static
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -698,8 +696,7 @@ struct __get_pair<0>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _T1&&
get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
};
template <>
@@ -717,8 +714,7 @@ struct __get_pair<1>
const _T2&
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>
static
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -730,8 +726,7 @@ struct __get_pair<1>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _T2&&
get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
};
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);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#ifndef _LIBCPP_CXX03_LANG
template <size_t _Ip, class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
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));
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 11
template <class _T1, class _T2>