]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++/tuple: Guard P2321R2 changes with __cpp_lib_ranges_zip
authorPatrick Palka <ppalka@redhat.com>
Thu, 18 Jan 2024 16:21:16 +0000 (11:21 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 18 Jan 2024 16:21:16 +0000 (11:21 -0500)
Guard <tuple> additions from P2321R2 zip with __cpp_lib_ranges_zip
instead of __cplusplus > 202020L.

libstdc++-v3/ChangeLog:

* include/std/tuple [__cplusplus > 202002L]: Guard P2321R2
changes with __cpp_lib_ranges_zip instead.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/include/std/tuple

index 2f6e419ea5bf13d1eac05e088c00e997d49f5e23..7a045b3e6a13ca6381e699f4a4f5348d4fe564f8 100644 (file)
@@ -324,7 +324,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)))
        { }
 
-#if __cplusplus > 202002L
+#if __cpp_lib_ranges_zip // >= C++23
       template<typename... _UElements>
        constexpr
        _Tuple_impl(_Tuple_impl<_Idx, _UElements...>& __in)
@@ -405,7 +405,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)))
        { }
 
-#if __cplusplus > 202002L
+#if __cpp_lib_ranges_zip // >= C++23
       template<typename _Alloc, typename _UHead, typename... _UTails>
        constexpr
        _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
@@ -449,7 +449,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
              std::move(_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in)));
        }
 
-#if __cplusplus > 202002L
+#if __cpp_lib_ranges_zip // >= C++23
       template<typename... _UElements>
        constexpr void
        _M_assign(const _Tuple_impl<_Idx, _UElements...>& __in) const
@@ -480,7 +480,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _Inherited::_M_swap(_M_tail(__in));
       }
 
-#if __cplusplus > 202002L
+#if __cpp_lib_ranges_zip // >= C++23
       constexpr void
       _M_swap(const _Tuple_impl& __in) const
       {
@@ -549,7 +549,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        : _Base(std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)))
        { }
 
-#if __cplusplus > 202002L
+#if __cpp_lib_ranges_zip // >= C++23
       template<typename _UHead>
        constexpr
        _Tuple_impl(_Tuple_impl<_Idx, _UHead>& __in)
@@ -615,7 +615,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)))
        { }
 
-#if __cplusplus > 202002L
+#if __cpp_lib_ranges_zip // >= C++23
       template<typename _Alloc, typename _UHead>
        constexpr
        _Tuple_impl(allocator_arg_t, const _Alloc& __a,
@@ -650,7 +650,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            = std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in));
        }
 
-#if __cplusplus > 202002L
+#if __cpp_lib_ranges_zip // >= C++23
       template<typename _UHead>
        constexpr void
        _M_assign(const _Tuple_impl<_Idx, _UHead>& __in) const
@@ -676,7 +676,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        swap(_M_head(*this), _M_head(__in));
       }
 
-#if __cplusplus > 202002L
+#if __cpp_lib_ranges_zip // >= C++23
       constexpr void
       _M_swap(const _Tuple_impl& __in) const
       {
@@ -1775,7 +1775,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     public:
       _GLIBCXX20_CONSTEXPR
       void swap(tuple&) noexcept { /* no-op */ }
-#if __cplusplus > 202002L
+#if __cpp_lib_ranges_zip // >= C++23
       constexpr void swap(const tuple&) const noexcept { /* no-op */ }
 #endif
       // We need the default since we're going to define no-op