This is a C++ >= 26 codepath for supporting constexpr stable_sort, so we
know that we have if consteval available; it just needs protection with
the feature-testing macro. Also merge the return in the same statement.
Amends
r15-7708-gff43f9853d3b10.
libstdc++-v3/ChangeLog:
* include/bits/stl_algo.h (__stable_sort): Use if consteval
instead of is_constant_evaluated.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
return;
#if _GLIBCXX_HOSTED
- if (__is_constant_evaluated())
- {
- std::__inplace_stable_sort(__first, __last, __comp);
- return;
- }
+# if __glibcxx_constexpr_algorithms >= 202306L // >= C++26
+ if consteval {
+ return std::__inplace_stable_sort(__first, __last, __comp);
+ }
+# endif
typedef _Temporary_buffer<_RandomAccessIterator, _ValueType> _TmpBuf;
// __stable_sort_adaptive sorts the range in two halves,