summaryrefslogtreecommitdiff
path: root/libcxx/include/algorithm
diff options
context:
space:
mode:
authorA. Jiang <de34@live.cn>2025-03-20 01:59:32 +0800
committerGitHub <noreply@github.com>2025-03-20 01:59:32 +0800
commit053a714adda3e1d3d506f417c7fbc6eb3fa75405 (patch)
tree7c80bdc344a04e4ba2814ad446be372b018c6441 /libcxx/include/algorithm
parent825460a7728662d0062405e690485b7a1b689484 (diff)
[libc++] Implement part of P2562R1: constexpr `ranges::inplace_merge` (#131947)
Drive-by changes: - Consistently mark `std::__inplace_merge::__inplace_merge_impl` `_LIBCPP_CONSTEXPR_SINCE_CXX26`. - This function template is only called by other functions that becomes constexpr since C++26, and it itself calls `std::__inplace_merge` that is constexpr since C++26. - Unblock related test coverage in constant evaluation for `stable_partition`, `ranges::stable_sort`, `std::stable_sort`, `std::stable_partition`, and `std::inplace_merge`.
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r--libcxx/include/algorithm7
1 files changed, 4 insertions, 3 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index aea24e53019c..6ba903ad3ce1 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1031,13 +1031,14 @@ namespace ranges {
template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
class Proj = identity>
requires sortable<I, Comp, Proj>
- I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr I // constexpr since C++26
+ inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<bidirectional_range R, class Comp = ranges::less, class Proj = identity>
requires sortable<iterator_t<R>, Comp, Proj>
- borrowed_iterator_t<R>
+ constexpr borrowed_iterator_t<R> // constexpr since C++26
inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {},
- Proj proj = {}); // since C++20
+ Proj proj = {}); // since C++20
template<permutable I, sentinel_for<I> S, class Proj = identity,
indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to>