Skip to content

Commit f66d6cd

Browse files
jensmaurertkoeppe
authored andcommitted
P2562R1 constexpr Stable Sorting
1 parent b1fdcd5 commit f66d6cd

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

source/algorithms.tex

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,9 +2011,9 @@
20112011
}
20122012

20132013
template<class RandomAccessIterator>
2014-
void stable_sort(RandomAccessIterator first, RandomAccessIterator last);
2014+
constexpr void stable_sort(RandomAccessIterator first, RandomAccessIterator last);
20152015
template<class RandomAccessIterator, class Compare>
2016-
void stable_sort(RandomAccessIterator first, RandomAccessIterator last,
2016+
constexpr void stable_sort(RandomAccessIterator first, RandomAccessIterator last,
20172017
Compare comp);
20182018
template<class ExecutionPolicy, class RandomAccessIterator>
20192019
void stable_sort(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
@@ -2027,10 +2027,10 @@
20272027
template<@\libconcept{random_access_iterator}@ I, @\libconcept{sentinel_for}@<I> S, class Comp = ranges::less,
20282028
class Proj = identity>
20292029
requires @\libconcept{sortable}@<I, Comp, Proj>
2030-
I stable_sort(I first, S last, Comp comp = {}, Proj proj = {});
2030+
constexpr I stable_sort(I first, S last, Comp comp = {}, Proj proj = {});
20312031
template<@\libconcept{random_access_range}@ R, class Comp = ranges::less, class Proj = identity>
20322032
requires @\libconcept{sortable}@<iterator_t<R>, Comp, Proj>
2033-
borrowed_iterator_t<R>
2033+
constexpr borrowed_iterator_t<R>
20342034
stable_sort(R&& r, Comp comp = {}, Proj proj = {});
20352035
}
20362036

@@ -2311,9 +2311,9 @@
23112311
}
23122312

23132313
template<class BidirectionalIterator, class Predicate>
2314-
BidirectionalIterator stable_partition(BidirectionalIterator first,
2315-
BidirectionalIterator last,
2316-
Predicate pred);
2314+
constexpr BidirectionalIterator stable_partition(BidirectionalIterator first,
2315+
BidirectionalIterator last,
2316+
Predicate pred);
23172317
template<class ExecutionPolicy, class BidirectionalIterator, class Predicate>
23182318
BidirectionalIterator stable_partition(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
23192319
BidirectionalIterator first,
@@ -2324,11 +2324,11 @@
23242324
template<@\libconcept{bidirectional_iterator}@ I, @\libconcept{sentinel_for}@<I> S, class Proj = identity,
23252325
@\libconcept{indirect_unary_predicate}@<projected<I, Proj>> Pred>
23262326
requires @\libconcept{permutable}@<I>
2327-
subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {});
2327+
constexpr subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {});
23282328
template<@\libconcept{bidirectional_range}@ R, class Proj = identity,
23292329
@\libconcept{indirect_unary_predicate}@<projected<iterator_t<R>, Proj>> Pred>
23302330
requires @\libconcept{permutable}@<iterator_t<R>>
2331-
borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {});
2331+
constexpr borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {});
23322332
}
23332333

23342334
template<class InputIterator, class OutputIterator1,
@@ -2427,13 +2427,13 @@
24272427
}
24282428

24292429
template<class BidirectionalIterator>
2430-
void inplace_merge(BidirectionalIterator first,
2431-
BidirectionalIterator middle,
2432-
BidirectionalIterator last);
2430+
constexpr void inplace_merge(BidirectionalIterator first,
2431+
BidirectionalIterator middle,
2432+
BidirectionalIterator last);
24332433
template<class BidirectionalIterator, class Compare>
2434-
void inplace_merge(BidirectionalIterator first,
2435-
BidirectionalIterator middle,
2436-
BidirectionalIterator last, Compare comp);
2434+
constexpr void inplace_merge(BidirectionalIterator first,
2435+
BidirectionalIterator middle,
2436+
BidirectionalIterator last, Compare comp);
24372437
template<class ExecutionPolicy, class BidirectionalIterator>
24382438
void inplace_merge(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
24392439
BidirectionalIterator first,
@@ -2449,10 +2449,10 @@
24492449
template<@\libconcept{bidirectional_iterator}@ I, @\libconcept{sentinel_for}@<I> S, class Comp = ranges::less,
24502450
class Proj = identity>
24512451
requires @\libconcept{sortable}@<I, Comp, Proj>
2452-
I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {});
2452+
constexpr I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {});
24532453
template<@\libconcept{bidirectional_range}@ R, class Comp = ranges::less, class Proj = identity>
24542454
requires @\libconcept{sortable}@<iterator_t<R>, Comp, Proj>
2455-
borrowed_iterator_t<R>
2455+
constexpr borrowed_iterator_t<R>
24562456
inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {},
24572457
Proj proj = {});
24582458
}

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@
592592
#define @\defnlibxname{cpp_lib_common_reference_wrapper}@ 202302L // also in \libheader{functional}
593593
#define @\defnlibxname{cpp_lib_complex_udls}@ 201309L // also in \libheader{complex}
594594
#define @\defnlibxname{cpp_lib_concepts}@ 202207L // also in \libheader{concepts}, \libheader{compare}
595-
#define @\defnlibxname{cpp_lib_constexpr_algorithms}@ 201806L // also in \libheader{algorithm}, \libheader{utility}
595+
#define @\defnlibxname{cpp_lib_constexpr_algorithms}@ 202306L // also in \libheader{algorithm}, \libheader{utility}
596596
#define @\defnlibxname{cpp_lib_constexpr_bitset}@ 202207L // also in \libheader{bitset}
597597
#define @\defnlibxname{cpp_lib_constexpr_charconv}@ 202207L // also in \libheader{charconv}
598598
#define @\defnlibxname{cpp_lib_constexpr_cmath}@ 202202L // also in \libheader{cmath}, \libheader{cstdlib}

0 commit comments

Comments
 (0)