From 2e11e41efacd3c5d3db8d421edbbd51939d27668 Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Tue, 16 Jan 2024 21:40:02 -0500 Subject: [PATCH] libstdc++/pair: Guard P2321R2 changes with __glibcxx_ranges_zip Similar to the previous change for , but since stl_pair.h is an internal header we need to use the corresponding internal macro instead. libstdc++-v3/ChangeLog: * include/bits/stl_pair.h [__cplusplus > 202002L]: Guard P2321R2 changes with __glibcxx_ranges_zip instead. --- libstdc++-v3/include/bits/stl_pair.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h index 3f1624f40b4e..3a042377a203 100644 --- a/libstdc++-v3/include/bits/stl_pair.h +++ b/libstdc++-v3/include/bits/stl_pair.h @@ -212,7 +212,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION swap(second, __p.second); } -#if __cplusplus > 202002L +#if __glibcxx_ranges_zip // >= C++23 // As an extension, we constrain the const swap member function in order // to continue accepting explicit instantiation of pairs whose elements // are not all const swappable. Without this constraint, such an @@ -353,7 +353,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr explicit(!_S_convertible<_U1, _U2>()) pair(pair<_U1, _U2>&&) = delete; -#if __cplusplus > 202002L +#if __glibcxx_ranges_zip // >= C++23 /// Converting constructor from a non-const `pair` lvalue template requires (_S_constructible<_U1&, _U2&>()) && (!_S_dangles<_U1&, _U2&>()) @@ -457,7 +457,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return *this; } -#if __cplusplus > 202002L +#if __glibcxx_ranges_zip // >= C++23 /// Copy assignment operator (const) constexpr const pair& operator=(const pair& __p) const @@ -880,7 +880,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } -#if __cplusplus > 202002L +#if __glibcxx_ranges_zip // >= C++23 template requires is_swappable_v && is_swappable_v constexpr void @@ -1094,7 +1094,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION get(const pair<_Up, _Tp>&& __p) noexcept { return std::move(__p.second); } -#if __cplusplus > 202002L +#if __glibcxx_ranges_zip // >= C++23 template class _TQual, template class _UQual> requires requires { typename pair, _UQual<_U1>>,