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

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 18 18:23:39 PDT 2017


Author: ericwf
Date: Tue Apr 18 20:23:39 2017
New Revision: 300644

URL: http://llvm.org/viewvc/llvm-project?rev=300644&view=rev
Log:
Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utility

Modified:
    libcxx/trunk/include/__tuple
    libcxx/trunk/include/tuple
    libcxx/trunk/include/utility

Modified: libcxx/trunk/include/__tuple
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__tuple?rev=300644&r1=300643&r2=300644&view=diff
==============================================================================
--- libcxx/trunk/include/__tuple (original)
+++ libcxx/trunk/include/__tuple Tue Apr 18 20:23:39 2017
@@ -85,7 +85,7 @@ template <class _Tp> struct __tuple_like
 
 // 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_CONSTE
 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_CONSTE
 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_co
     template <class ...>
     static constexpr bool __enable_assign() { return false; }
 };
-#endif
+#endif // !defined(_LIBCPP_CXX03_LANG)
 
 #if _LIBCPP_STD_VER > 14
 

Modified: libcxx/trunk/include/tuple
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/tuple?rev=300644&r1=300643&r2=300644&view=diff
==============================================================================
--- libcxx/trunk/include/tuple (original)
+++ libcxx/trunk/include/tuple Tue Apr 18 20:23:39 2017
@@ -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
       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

Modified: libcxx/trunk/include/utility
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/utility?rev=300644&r1=300643&r2=300644&view=diff
==============================================================================
--- libcxx/trunk/include/utility (original)
+++ libcxx/trunk/include/utility Tue Apr 18 20:23:39 2017
@@ -272,14 +272,14 @@ swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _
 
 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>
 #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>
     __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) _NOEXCEP
 {
     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>




More information about the cfe-commits mailing list