diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2025-03-14 15:47:10 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2025-03-27 13:47:30 +0100 |
commit | 698ef4b29d875b9ab8903e95633f1473a29c217b (patch) | |
tree | c72ef3745a50e56bfabd4b724fa32f1703bfc522 /libcpp | |
parent | 8e99bd447c459d8f298a70355a89122683d7b149 (diff) | |
download | gcc-698ef4b29d875b9ab8903e95633f1473a29c217b.zip gcc-698ef4b29d875b9ab8903e95633f1473a29c217b.tar.gz gcc-698ef4b29d875b9ab8903e95633f1473a29c217b.tar.bz2 |
libstdc++: add constexpr inplace_merge
This commit adds support for constexpr inplace_merge, added by P2562R1
for C++26. The implementation strategy is the same as for constexpr
stable_sort: use if consteval to detect if we're in constant evaluation,
and dispatch to a suitable path (same one as freestanding).
libstdc++-v3/ChangeLog:
* include/bits/algorithmfwd.h (inplace_merge): Mark it as
constexpr for C++26.
* include/bits/ranges_algo.h (__inplace_merge_fn): Likewise.
* include/bits/stl_algo.h (inplace_merge): Mark it as constexpr;
during constant evaluation, dispatch to the non-allocating
codepath.
* testsuite/25_algorithms/headers/algorithm/synopsis.cc
(inplace_merge): Add constexpr.
* testsuite/25_algorithms/inplace_merge/constexpr.cc: New test.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions