aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-09-18 16:17:28 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-09-22 17:45:06 +0100
commitb6463161c3cd0b1f764697290d9569c7153b8a5b (patch)
tree64384bdb74d730463b364ed319245505437dd59a
parent164c1b1f812da5d1e00fc10a415e80f7c508efcb (diff)
downloadgcc-b6463161c3cd0b1f764697290d9569c7153b8a5b.zip
gcc-b6463161c3cd0b1f764697290d9569c7153b8a5b.tar.gz
gcc-b6463161c3cd0b1f764697290d9569c7153b8a5b.tar.bz2
libstdc++: Use constexpr instead of _GLIBCXX20_CONSTEXPR in <vector>
For the operator<=> overload we can use the 'constexpr' keyword directly, because we know the language dialect is at least C++20. libstdc++-v3/ChangeLog: * include/bits/stl_vector.h (operator<=>): Use constexpr instead of _GLIBCXX20_CONSTEXPR macro.
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 182ad41..e284536 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -2078,7 +2078,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ return (__x.size() == __y.size()
&& std::equal(__x.begin(), __x.end(), __y.begin())); }
-#if __cpp_lib_three_way_comparison
+#if __cpp_lib_three_way_comparison // >= C++20
/**
* @brief Vector ordering relation.
* @param __x A `vector`.
@@ -2091,8 +2091,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* `<` and `>=` etc.
*/
template<typename _Tp, typename _Alloc>
- [[nodiscard]] _GLIBCXX20_CONSTEXPR
- inline __detail::__synth3way_t<_Tp>
+ [[nodiscard]]
+ constexpr __detail::__synth3way_t<_Tp>
operator<=>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{
return std::lexicographical_compare_three_way(__x.begin(), __x.end(),