Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1 | // -*- C++ -*- |
Louis Dionne | eb8650a | 2021-11-17 21:25:01 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 3 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 | [diff] [blame] | 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP_ALGORITHM |
| 11 | #define _LIBCPP_ALGORITHM |
| 12 | |
| 13 | /* |
| 14 | algorithm synopsis |
| 15 | |
| 16 | #include <initializer_list> |
| 17 | |
| 18 | namespace std |
| 19 | { |
| 20 | |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 21 | namespace ranges { |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 22 | |
| 23 | // [algorithms.results], algorithm result types |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 24 | template <class I, class F> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 25 | struct in_fun_result; // since C++20 |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 26 | |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 27 | template <class I1, class I2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 28 | struct in_in_result; // since C++20 |
Nikolas Klauser | f3514af | 2022-01-25 10:21:47 | [diff] [blame] | 29 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 30 | template <class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 31 | struct in_out_result; // since C++20 |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 32 | |
Nikolas Klauser | f3514af | 2022-01-25 10:21:47 | [diff] [blame] | 33 | template <class I1, class I2, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 34 | struct in_in_out_result; // since C++20 |
Nikolas Klauser | 610979b | 2022-02-03 01:17:03 | [diff] [blame] | 35 | |
| 36 | template <class I, class O1, class O2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 37 | struct in_out_out_result; // since C++20 |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 38 | |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 39 | template <class I1, class I2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 40 | struct min_max_result; // since C++20 |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 41 | |
Nikolas Klauser | 68f4131 | 2022-02-21 22:07:02 | [diff] [blame] | 42 | template <class I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 43 | struct in_found_result; // since C++20 |
Nikolas Klauser | 68f4131 | 2022-02-21 22:07:02 | [diff] [blame] | 44 | |
Christopher Di Bella | 3903438 | 2023-12-20 05:57:50 | [diff] [blame] | 45 | template <class I, class T> |
| 46 | struct in_value_result; // since C++23 |
| 47 | |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 48 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 49 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // since C++20 |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 50 | constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {}); |
| 51 | |
| 52 | template<forward_range R, class Proj = identity, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 53 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> // since C++20 |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 54 | constexpr borrowed_iterator_t<R> min_element(R&& r, Comp comp = {}, Proj proj = {}); |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 55 | |
Nikolas Klauser | 40f7fca3 | 2022-05-22 11:43:37 | [diff] [blame] | 56 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 57 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 58 | constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 40f7fca3 | 2022-05-22 11:43:37 | [diff] [blame] | 59 | |
| 60 | template<forward_range R, class Proj = identity, |
| 61 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 62 | constexpr borrowed_iterator_t<R> ranges::max_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 40f7fca3 | 2022-05-22 11:43:37 | [diff] [blame] | 63 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 64 | template<class I1, class I2> |
| 65 | using mismatch_result = in_in_result<I1, I2>; |
| 66 | |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 67 | template <input_iterator I1, sentinel_for<_I1> S1, input_iterator I2, sentinel_for<_I2> S2, |
| 68 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 69 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 70 | constexpr mismatch_result<_I1, _I2> // since C++20 |
| 71 | mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 72 | |
| 73 | template <input_range R1, input_range R2, |
| 74 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 75 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 76 | constexpr mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 77 | mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 78 | |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 79 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 80 | constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 81 | |
| 82 | template<input_range R, class T, class Proj = identity> |
| 83 | requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 84 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 85 | find(R&& r, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 86 | |
| 87 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 88 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 89 | constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 90 | |
| 91 | template<input_range R, class Proj = identity, |
| 92 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 93 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 94 | find_if(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 95 | |
| 96 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 97 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 98 | constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 99 | |
| 100 | template<input_range R, class Proj = identity, |
| 101 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 102 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 103 | find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 104 | |
nicole mazzuca | 04760bf | 2024-07-19 16:42:16 | [diff] [blame] | 105 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity> |
| 106 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 107 | constexpr subrange<I> find_last(I first, S last, const T& value, Proj proj = {}); // since C++23 |
| 108 | |
| 109 | template<forward_range R, class T, class Proj = identity> |
| 110 | requires |
| 111 | indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 112 | constexpr borrowed_subrange_t<R> find_last(R&& r, const T& value, Proj proj = {}); // since C++23 |
| 113 | |
| 114 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 115 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 116 | constexpr subrange<I> find_last_if(I first, S last, Pred pred, Proj proj = {}); // since C++23 |
| 117 | |
| 118 | template<forward_range R, class Proj = identity, |
| 119 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 120 | constexpr borrowed_subrange_t<R> find_last_if(R&& r, Pred pred, Proj proj = {}); // since C++23 |
| 121 | |
| 122 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 123 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 124 | constexpr subrange<I> find_last_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++23 |
| 125 | |
| 126 | template<forward_range R, class Proj = identity, |
| 127 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 128 | constexpr borrowed_subrange_t<R> find_last_if_not(R&& r, Pred pred, Proj proj = {}); // since C++23 |
| 129 | |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 130 | template<class T, class Proj = identity, |
| 131 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 132 | constexpr const T& min(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 133 | |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 134 | template<copyable T, class Proj = identity, |
| 135 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 136 | constexpr T min(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 137 | |
| 138 | template<input_range R, class Proj = identity, |
| 139 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 140 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 141 | constexpr range_value_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 142 | min(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 143 | |
| 144 | template<class T, class Proj = identity, |
| 145 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 146 | constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 147 | |
| 148 | template<copyable T, class Proj = identity, |
| 149 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 150 | constexpr T max(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 151 | |
| 152 | template<input_range R, class Proj = identity, |
| 153 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 154 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 155 | constexpr range_value_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 156 | max(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 157 | |
| 158 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 159 | using unary_transform_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 160 | |
| 161 | template<class I1, class I2, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 162 | using binary_transform_result = in_in_out_result<I1, I2, O>; // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 163 | |
| 164 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, |
| 165 | copy_constructible F, class Proj = identity> |
| 166 | requires indirectly_writable<O, indirect_result_t<F&, projected<I, Proj>>> |
| 167 | constexpr ranges::unary_transform_result<I, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 168 | transform(I first1, S last1, O result, F op, Proj proj = {}); // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 169 | |
| 170 | template<input_range R, weakly_incrementable O, copy_constructible F, |
| 171 | class Proj = identity> |
| 172 | requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R>, Proj>>> |
| 173 | constexpr ranges::unary_transform_result<borrowed_iterator_t<R>, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 174 | transform(R&& r, O result, F op, Proj proj = {}); // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 175 | |
| 176 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 177 | weakly_incrementable O, copy_constructible F, class Proj1 = identity, |
| 178 | class Proj2 = identity> |
| 179 | requires indirectly_writable<O, indirect_result_t<F&, projected<I1, Proj1>, |
| 180 | projected<I2, Proj2>>> |
| 181 | constexpr ranges::binary_transform_result<I1, I2, O> |
| 182 | transform(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 183 | F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 184 | |
| 185 | template<input_range R1, input_range R2, weakly_incrementable O, |
| 186 | copy_constructible F, class Proj1 = identity, class Proj2 = identity> |
| 187 | requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R1>, Proj1>, |
| 188 | projected<iterator_t<R2>, Proj2>>> |
| 189 | constexpr ranges::binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> |
| 190 | transform(R1&& r1, R2&& r2, O result, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 191 | F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 192 | |
| 193 | template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity> |
| 194 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 195 | constexpr iter_difference_t<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 196 | count(I first, S last, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 197 | |
| 198 | template<input_range R, class T, class Proj = identity> |
| 199 | requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 200 | constexpr range_difference_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 201 | count(R&& r, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 202 | |
| 203 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 204 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 205 | constexpr iter_difference_t<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 206 | count_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 207 | |
| 208 | template<input_range R, class Proj = identity, |
| 209 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 210 | constexpr range_difference_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 211 | count_if(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 212 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 213 | template<class T> |
| 214 | using minmax_result = min_max_result<T>; |
| 215 | |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 216 | template<class T, class Proj = identity, |
| 217 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 218 | constexpr ranges::minmax_result<const T&> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 219 | minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 220 | |
| 221 | template<copyable T, class Proj = identity, |
| 222 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 223 | constexpr ranges::minmax_result<T> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 224 | minmax(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 225 | |
| 226 | template<input_range R, class Proj = identity, |
| 227 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 228 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 229 | constexpr ranges::minmax_result<range_value_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 230 | minmax(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 231 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 232 | template<class I> |
| 233 | using minmax_element_result = min_max_result<I>; |
| 234 | |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 235 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 236 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 237 | constexpr ranges::minmax_element_result<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 238 | minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 239 | |
| 240 | template<forward_range R, class Proj = identity, |
| 241 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 242 | constexpr ranges::minmax_element_result<borrowed_iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 243 | minmax_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 244 | |
ZijunZhaoCCK | a6b846a | 2024-02-13 23:42:37 | [diff] [blame] | 245 | template<forward_iterator I1, sentinel_for<I1> S1, |
| 246 | forward_iterator I2, sentinel_for<I2> S2, |
| 247 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 248 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 249 | constexpr bool contains_subrange(I1 first1, S1 last1, I2 first2, S2 last2, |
| 250 | Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 251 | |
| 252 | template<forward_range R1, forward_range R2, |
| 253 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 254 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 255 | constexpr bool contains_subrange(R1&& r1, R2&& r2, Pred pred = {}, |
| 256 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 257 | |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 258 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 259 | using copy_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 260 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 261 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 262 | using copy_n_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 263 | |
| 264 | template<class I, class O> |
| 265 | using copy_if_result = in_out_result<I, O>; // since C++20 |
| 266 | |
| 267 | template<class I1, class I2> |
| 268 | using copy_backward_result = in_out_result<I1, I2>; // since C++20 |
| 269 | |
ZijunZhaoCCK | fdd089b | 2023-12-20 00:34:19 | [diff] [blame] | 270 | template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity> |
| 271 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 272 | constexpr bool ranges::contains(I first, S last, const T& value, Proj proj = {}); // since C++23 |
| 273 | |
| 274 | template<input_range R, class T, class Proj = identity> |
| 275 | requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 276 | constexpr bool ranges::contains(R&& r, const T& value, Proj proj = {}); // since C++23 |
| 277 | |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 278 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O> |
| 279 | requires indirectly_copyable<I, O> |
| 280 | constexpr ranges::copy_result<I, O> ranges::copy(I first, S last, O result); // since C++20 |
| 281 | |
| 282 | template<input_range R, weakly_incrementable O> |
| 283 | requires indirectly_copyable<iterator_t<R>, O> |
| 284 | constexpr ranges::copy_result<borrowed_iterator_t<R>, O> ranges::copy(R&& r, O result); // since C++20 |
| 285 | |
| 286 | template<input_iterator I, weakly_incrementable O> |
| 287 | requires indirectly_copyable<I, O> |
| 288 | constexpr ranges::copy_n_result<I, O> |
| 289 | ranges::copy_n(I first, iter_difference_t<I> n, O result); // since C++20 |
| 290 | |
| 291 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Proj = identity, |
| 292 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 293 | requires indirectly_copyable<I, O> |
| 294 | constexpr ranges::copy_if_result<I, O> |
| 295 | ranges::copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // since C++20 |
| 296 | |
| 297 | template<input_range R, weakly_incrementable O, class Proj = identity, |
| 298 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 299 | requires indirectly_copyable<iterator_t<R>, O> |
| 300 | constexpr ranges::copy_if_result<borrowed_iterator_t<R>, O> |
| 301 | ranges::copy_if(R&& r, O result, Pred pred, Proj proj = {}); // since C++20 |
| 302 | |
| 303 | template<bidirectional_iterator I1, sentinel_for<I1> S1, bidirectional_iterator I2> |
| 304 | requires indirectly_copyable<I1, I2> |
| 305 | constexpr ranges::copy_backward_result<I1, I2> |
| 306 | ranges::copy_backward(I1 first, S1 last, I2 result); // since C++20 |
| 307 | |
| 308 | template<bidirectional_range R, bidirectional_iterator I> |
| 309 | requires indirectly_copyable<iterator_t<R>, I> |
| 310 | constexpr ranges::copy_backward_result<borrowed_iterator_t<R>, I> |
| 311 | ranges::copy_backward(R&& r, I result); // since C++20 |
Nikolas Klauser | 80045e9 | 2022-05-04 18:27:07 | [diff] [blame] | 312 | |
| 313 | template<class I, class F> |
| 314 | using for_each_result = in_fun_result<I, F>; // since C++20 |
| 315 | |
Louis Dionne | 09e3a36 | 2024-09-16 19:06:20 | [diff] [blame] | 316 | template<class I, class F> |
| 317 | using for_each_n_result = in_fun_result<I, F>; // since C++20 |
| 318 | |
Nikolas Klauser | 80045e9 | 2022-05-04 18:27:07 | [diff] [blame] | 319 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 320 | indirectly_unary_invocable<projected<I, Proj>> Fun> |
| 321 | constexpr ranges::for_each_result<I, Fun> |
| 322 | ranges::for_each(I first, S last, Fun f, Proj proj = {}); // since C++20 |
| 323 | |
| 324 | template<input_range R, class Proj = identity, |
| 325 | indirectly_unary_invocable<projected<iterator_t<R>, Proj>> Fun> |
| 326 | constexpr ranges::for_each_result<borrowed_iterator_t<R>, Fun> |
| 327 | ranges::for_each(R&& r, Fun f, Proj proj = {}); // since C++20 |
| 328 | |
| 329 | template<input_iterator I, class Proj = identity, |
| 330 | indirectly_unary_invocable<projected<I, Proj>> Fun> |
| 331 | constexpr ranges::for_each_n_result<I, Fun> |
| 332 | ranges::for_each_n(I first, iter_difference_t<I> n, Fun f, Proj proj = {}); // since C++20 |
Nikolas Klauser | 37ba1b9 | 2022-05-04 12:19:09 | [diff] [blame] | 333 | |
| 334 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 335 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 336 | constexpr bool ranges::is_partitioned(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 337 | |
| 338 | template<input_range R, class Proj = identity, |
| 339 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 340 | constexpr bool ranges::is_partitioned(R&& r, Pred pred, Proj proj = {}); // since C++20 |
| 341 | |
Konstantin Varlamov | c945bd0 | 2022-07-08 20:46:27 | [diff] [blame] | 342 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 343 | class Proj = identity> |
| 344 | requires sortable<I, Comp, Proj> |
| 345 | constexpr I |
| 346 | ranges::push_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 347 | |
| 348 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 349 | requires sortable<iterator_t<R>, Comp, Proj> |
| 350 | constexpr borrowed_iterator_t<R> |
| 351 | ranges::push_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 352 | |
| 353 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 354 | class Proj = identity> |
| 355 | requires sortable<I, Comp, Proj> |
| 356 | constexpr I |
| 357 | ranges::pop_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 358 | |
| 359 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 360 | requires sortable<iterator_t<R>, Comp, Proj> |
| 361 | constexpr borrowed_iterator_t<R> |
| 362 | ranges::pop_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 363 | |
| 364 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 365 | class Proj = identity> |
| 366 | requires sortable<I, Comp, Proj> |
| 367 | constexpr I |
| 368 | ranges::make_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 369 | |
| 370 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 371 | requires sortable<iterator_t<R>, Comp, Proj> |
| 372 | constexpr borrowed_iterator_t<R> |
| 373 | ranges::make_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 374 | |
| 375 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 376 | class Proj = identity> |
| 377 | requires sortable<I, Comp, Proj> |
| 378 | constexpr I |
| 379 | ranges::sort_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 380 | |
| 381 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 382 | requires sortable<iterator_t<R>, Comp, Proj> |
| 383 | constexpr borrowed_iterator_t<R> |
| 384 | ranges::sort_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 385 | |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 386 | template<random_access_iterator I, sentinel_for<I> S, class Proj = identity, |
| 387 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 388 | constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 389 | |
| 390 | template<random_access_range R, class Proj = identity, |
| 391 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 392 | constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 393 | |
| 394 | template<random_access_iterator I, sentinel_for<I> S, class Proj = identity, |
| 395 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 396 | constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 397 | |
| 398 | template<random_access_range R, class Proj = identity, |
| 399 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 400 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 401 | is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 402 | |
Nikolas Klauser | 1d1a191 | 2022-05-24 08:32:50 | [diff] [blame] | 403 | template<bidirectional_iterator I, sentinel_for<I> S> |
| 404 | requires permutable<I> |
| 405 | constexpr I ranges::reverse(I first, S last); // since C++20 |
| 406 | |
| 407 | template<bidirectional_range R> |
| 408 | requires permutable<iterator_t<R>> |
| 409 | constexpr borrowed_iterator_t<R> ranges::reverse(R&& r); // since C++20 |
| 410 | |
Konstantin Varlamov | ff3989e | 2022-06-16 22:20:53 | [diff] [blame] | 411 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 412 | class Proj = identity> |
| 413 | requires sortable<I, Comp, Proj> |
| 414 | constexpr I |
Konstantin Varlamov | 94c7b89 | 2022-07-01 23:34:08 | [diff] [blame] | 415 | ranges::sort(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | ff3989e | 2022-06-16 22:20:53 | [diff] [blame] | 416 | |
| 417 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 418 | requires sortable<iterator_t<R>, Comp, Proj> |
| 419 | constexpr borrowed_iterator_t<R> |
Konstantin Varlamov | 94c7b89 | 2022-07-01 23:34:08 | [diff] [blame] | 420 | ranges::sort(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 421 | |
| 422 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 423 | class Proj = identity> |
| 424 | requires sortable<I, Comp, Proj> |
| 425 | I ranges::stable_sort(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 426 | |
| 427 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 428 | requires sortable<iterator_t<R>, Comp, Proj> |
| 429 | borrowed_iterator_t<R> |
| 430 | ranges::stable_sort(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | ff3989e | 2022-06-16 22:20:53 | [diff] [blame] | 431 | |
varconst | 5dd19ad | 2022-07-20 03:10:02 | [diff] [blame] | 432 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 433 | class Proj = identity> |
| 434 | requires sortable<I, Comp, Proj> |
| 435 | constexpr I |
| 436 | ranges::partial_sort(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 437 | |
| 438 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 439 | requires sortable<iterator_t<R>, Comp, Proj> |
| 440 | constexpr borrowed_iterator_t<R> |
| 441 | ranges::partial_sort(R&& r, iterator_t<R> middle, Comp comp = {}, Proj proj = {}); // since C++20 |
| 442 | |
Nikolas Klauser | 7af89a3 | 2022-05-21 16:26:29 | [diff] [blame] | 443 | template<class T, output_iterator<const T&> O, sentinel_for<O> S> |
| 444 | constexpr O ranges::fill(O first, S last, const T& value); // since C++20 |
| 445 | |
| 446 | template<class T, output_range<const T&> R> |
| 447 | constexpr borrowed_iterator_t<R> ranges::fill(R&& r, const T& value); // since C++20 |
| 448 | |
| 449 | template<class T, output_iterator<const T&> O> |
| 450 | constexpr O ranges::fill_n(O first, iter_difference_t<O> n, const T& value); // since C++20 |
Nikolas Klauser | 569d663 | 2022-05-25 09:09:43 | [diff] [blame] | 451 | |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 452 | template<input_or_output_iterator O, sentinel_for<O> S, copy_constructible F> |
| 453 | requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 454 | constexpr O generate(O first, S last, F gen); // since C++20 |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 455 | |
Nikolas Klauser | cd91610 | 2023-06-09 20:45:34 | [diff] [blame] | 456 | template<class ExecutionPolicy, class ForwardIterator, class Generator> |
| 457 | void generate(ExecutionPolicy&& exec, |
| 458 | ForwardIterator first, ForwardIterator last, |
| 459 | Generator gen); // since C++17 |
| 460 | |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 461 | template<class R, copy_constructible F> |
| 462 | requires invocable<F&> && output_range<R, invoke_result_t<F&>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 463 | constexpr borrowed_iterator_t<R> generate(R&& r, F gen); // since C++20 |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 464 | |
| 465 | template<input_or_output_iterator O, copy_constructible F> |
| 466 | requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 467 | constexpr O generate_n(O first, iter_difference_t<O> n, F gen); // since C++20 |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 468 | |
Nikolas Klauser | cd91610 | 2023-06-09 20:45:34 | [diff] [blame] | 469 | template<class ExecutionPolicy, class ForwardIterator, class Size, class Generator> |
| 470 | ForwardIterator generate_n(ExecutionPolicy&& exec, |
| 471 | ForwardIterator first, Size n, Generator gen); // since C++17 |
| 472 | |
Nikolas Klauser | 569d663 | 2022-05-25 09:09:43 | [diff] [blame] | 473 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 474 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 475 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 476 | constexpr bool ranges::equal(I1 first1, S1 last1, I2 first2, S2 last2, |
| 477 | Pred pred = {}, |
| 478 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 479 | |
| 480 | template<input_range R1, input_range R2, class Pred = ranges::equal_to, |
| 481 | class Proj1 = identity, class Proj2 = identity> |
| 482 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 483 | constexpr bool ranges::equal(R1&& r1, R2&& r2, Pred pred = {}, |
| 484 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 485 | |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 486 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 487 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 488 | constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 489 | |
| 490 | template<input_range R, class Proj = identity, |
| 491 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 492 | constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 493 | |
| 494 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 495 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 496 | constexpr bool ranges::any_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 497 | |
| 498 | template<input_range R, class Proj = identity, |
| 499 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 500 | constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 501 | |
Zijun Zhao | 0218ea4 | 2023-09-18 18:28:11 | [diff] [blame] | 502 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 503 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 504 | requires (forward_iterator<I1> || sized_sentinel_for<S1, I1>) && |
| 505 | (forward_iterator<I2> || sized_sentinel_for<S2, I2>) && |
| 506 | indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 507 | constexpr bool ranges::ends_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, |
| 508 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 509 | |
| 510 | template<input_range R1, input_range R2, class Pred = ranges::equal_to, class Proj1 = identity, |
| 511 | class Proj2 = identity> |
| 512 | requires (forward_range<R1> || sized_range<R1>) && |
| 513 | (forward_range<R2> || sized_range<R2>) && |
| 514 | indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 515 | constexpr bool ranges::ends_with(R1&& r1, R2&& r2, Pred pred = {}, |
| 516 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 517 | |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 518 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 519 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 520 | constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 521 | |
| 522 | template<input_range R, class Proj = identity, |
| 523 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 524 | constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 525 | |
zijunzhao | 2051755 | 2023-05-08 22:04:00 | [diff] [blame] | 526 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 527 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 528 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 529 | constexpr bool ranges::starts_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, |
| 530 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 531 | |
| 532 | template<input_range R1, input_range R2, class Pred = ranges::equal_to, class Proj1 = identity, |
| 533 | class Proj2 = identity> |
| 534 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 535 | constexpr bool ranges::starts_with(R1&& r1, R2&& r2, Pred pred = {}, |
| 536 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 537 | |
Konstantin Varlamov | db7d795 | 2022-07-30 09:42:05 | [diff] [blame] | 538 | template<input_iterator I1, sentinel_for<I1> S1, |
| 539 | random_access_iterator I2, sentinel_for<I2> S2, |
| 540 | class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> |
| 541 | requires indirectly_copyable<I1, I2> && sortable<I2, Comp, Proj2> && |
| 542 | indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>> |
| 543 | constexpr partial_sort_copy_result<I1, I2> |
| 544 | partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 545 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Konstantin Varlamov | db7d795 | 2022-07-30 09:42:05 | [diff] [blame] | 546 | |
| 547 | template<input_range R1, random_access_range R2, class Comp = ranges::less, |
| 548 | class Proj1 = identity, class Proj2 = identity> |
| 549 | requires indirectly_copyable<iterator_t<R1>, iterator_t<R2>> && |
| 550 | sortable<iterator_t<R2>, Comp, Proj2> && |
| 551 | indirect_strict_weak_order<Comp, projected<iterator_t<R1>, Proj1>, |
| 552 | projected<iterator_t<R2>, Proj2>> |
| 553 | constexpr partial_sort_copy_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
| 554 | partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 555 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Konstantin Varlamov | db7d795 | 2022-07-30 09:42:05 | [diff] [blame] | 556 | |
Nikolas Klauser | 11e3ad2 | 2022-05-26 14:08:55 | [diff] [blame] | 557 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 558 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 559 | constexpr bool ranges::is_sorted(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 560 | |
| 561 | template<forward_range R, class Proj = identity, |
| 562 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 563 | constexpr bool ranges::is_sorted(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 564 | |
| 565 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 566 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 567 | constexpr I ranges::is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 568 | |
| 569 | template<forward_range R, class Proj = identity, |
| 570 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 571 | constexpr borrowed_iterator_t<R> |
| 572 | ranges::is_sorted_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 573 | |
Konstantin Varlamov | 23c7328 | 2022-07-08 03:35:51 | [diff] [blame] | 574 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 575 | class Proj = identity> |
| 576 | requires sortable<I, Comp, Proj> |
| 577 | constexpr I |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 578 | ranges::nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 23c7328 | 2022-07-08 03:35:51 | [diff] [blame] | 579 | |
| 580 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 581 | requires sortable<iterator_t<R>, Comp, Proj> |
| 582 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 583 | ranges::nth_element(R&& r, iterator_t<R> nth, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 23c7328 | 2022-07-08 03:35:51 | [diff] [blame] | 584 | |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 585 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 586 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> // since C++20 |
| 587 | constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 588 | |
| 589 | template<forward_range R, class T, class Proj = identity, |
| 590 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 591 | ranges::less> |
| 592 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 593 | upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 594 | |
| 595 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 596 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> |
| 597 | constexpr I lower_bound(I first, S last, const T& value, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 598 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 599 | template<forward_range R, class T, class Proj = identity, |
| 600 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 601 | ranges::less> |
| 602 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 603 | lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 604 | |
| 605 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 606 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> |
| 607 | constexpr bool binary_search(I first, S last, const T& value, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 608 | Proj proj = {}); // since C++20 |
Nikolas Klauser | b79b2b6 | 2022-06-06 11:57:34 | [diff] [blame] | 609 | |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 610 | template<forward_range R, class T, class Proj = identity, |
| 611 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 612 | ranges::less> |
| 613 | constexpr bool binary_search(R&& r, const T& value, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 614 | Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 615 | |
| 616 | template<permutable I, sentinel_for<I> S, class Proj = identity, |
| 617 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 618 | constexpr subrange<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 619 | partition(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 620 | |
| 621 | template<forward_range R, class Proj = identity, |
| 622 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 623 | requires permutable<iterator_t<R>> |
| 624 | constexpr borrowed_subrange_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 625 | partition(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 626 | |
| 627 | template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity, |
| 628 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 629 | requires permutable<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 630 | subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 631 | |
| 632 | template<bidirectional_range R, class Proj = identity, |
| 633 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 634 | requires permutable<iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 635 | borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 636 | |
Nikolas Klauser | b79b2b6 | 2022-06-06 11:57:34 | [diff] [blame] | 637 | template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2, |
| 638 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 639 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 640 | constexpr I1 ranges::find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, |
| 641 | Pred pred = {}, |
| 642 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 643 | |
| 644 | template<input_range R1, forward_range R2, |
| 645 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 646 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 647 | constexpr borrowed_iterator_t<R1> |
| 648 | ranges::find_first_of(R1&& r1, R2&& r2, |
| 649 | Pred pred = {}, |
| 650 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 651 | |
Nikolas Klauser | 916e905 | 2022-06-08 10:14:12 | [diff] [blame] | 652 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 653 | indirect_binary_predicate<projected<I, Proj>, |
| 654 | projected<I, Proj>> Pred = ranges::equal_to> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 655 | constexpr I ranges::adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 916e905 | 2022-06-08 10:14:12 | [diff] [blame] | 656 | |
| 657 | template<forward_range R, class Proj = identity, |
| 658 | indirect_binary_predicate<projected<iterator_t<R>, Proj>, |
| 659 | projected<iterator_t<R>, Proj>> Pred = ranges::equal_to> |
| 660 | constexpr borrowed_iterator_t<R> ranges::adjacent_find(R&& r, Pred pred = {}, Proj proj = {}); // since C++20 |
| 661 | |
Nikolas Klauser | ff6d5de | 2022-06-07 07:42:10 | [diff] [blame] | 662 | template<input_iterator I, sentinel_for<I> S, class T1, class T2, class Proj = identity> |
| 663 | requires indirectly_writable<I, const T2&> && |
| 664 | indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*> |
| 665 | constexpr I |
| 666 | ranges::replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {}); // since C++20 |
| 667 | |
| 668 | template<input_range R, class T1, class T2, class Proj = identity> |
| 669 | requires indirectly_writable<iterator_t<R>, const T2&> && |
| 670 | indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T1*> |
| 671 | constexpr borrowed_iterator_t<R> |
| 672 | ranges::replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {}); // since C++20 |
| 673 | |
| 674 | template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 675 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 676 | requires indirectly_writable<I, const T&> |
| 677 | constexpr I ranges::replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {}); // since C++20 |
| 678 | |
| 679 | template<input_range R, class T, class Proj = identity, |
| 680 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 681 | requires indirectly_writable<iterator_t<R>, const T&> |
| 682 | constexpr borrowed_iterator_t<R> |
| 683 | ranges::replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {}); // since C++20 |
| 684 | |
Nikolas Klauser | a203acb | 2022-08-03 23:30:50 | [diff] [blame] | 685 | template<class T, class Proj = identity, |
| 686 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 687 | constexpr const T& |
| 688 | ranges::clamp(const T& v, const T& lo, const T& hi, Comp comp = {}, Proj proj = {}); // since C++20 |
| 689 | |
Nikolas Klauser | afd5a4f | 2022-06-15 14:24:43 | [diff] [blame] | 690 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 691 | class Proj1 = identity, class Proj2 = identity, |
| 692 | indirect_strict_weak_order<projected<I1, Proj1>, |
| 693 | projected<I2, Proj2>> Comp = ranges::less> |
| 694 | constexpr bool |
| 695 | ranges::lexicographical_compare(I1 first1, S1 last1, I2 first2, S2 last2, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 696 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | afd5a4f | 2022-06-15 14:24:43 | [diff] [blame] | 697 | |
| 698 | template<input_range R1, input_range R2, class Proj1 = identity, |
| 699 | class Proj2 = identity, |
| 700 | indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>, |
| 701 | projected<iterator_t<R2>, Proj2>> Comp = ranges::less> |
| 702 | constexpr bool |
| 703 | ranges::lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 704 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | afd5a4f | 2022-06-15 14:24:43 | [diff] [blame] | 705 | |
Louis Dionne | 09e3a36 | 2024-09-16 19:06:20 | [diff] [blame] | 706 | template<class I, class O> |
| 707 | using move_result = in_out_result<I, O>; // since C++20 |
| 708 | |
| 709 | template<class I, class O> |
| 710 | using move_backward_result = in_out_result<I, O>; // since C++20 |
| 711 | |
Nikolas Klauser | 2c3bbac | 2022-06-23 10:23:41 | [diff] [blame] | 712 | template<bidirectional_iterator I1, sentinel_for<I1> S1, bidirectional_iterator I2> |
| 713 | requires indirectly_movable<I1, I2> |
| 714 | constexpr ranges::move_backward_result<I1, I2> |
| 715 | ranges::move_backward(I1 first, S1 last, I2 result); // since C++20 |
| 716 | |
| 717 | template<bidirectional_range R, bidirectional_iterator I> |
| 718 | requires indirectly_movable<iterator_t<R>, I> |
| 719 | constexpr ranges::move_backward_result<borrowed_iterator_t<R>, I> |
| 720 | ranges::move_backward(R&& r, I result); // since C++20 |
| 721 | |
| 722 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O> |
| 723 | requires indirectly_movable<I, O> |
| 724 | constexpr ranges::move_result<I, O> |
| 725 | ranges::move(I first, S last, O result); // since C++20 |
| 726 | |
| 727 | template<input_range R, weakly_incrementable O> |
| 728 | requires indirectly_movable<iterator_t<R>, O> |
| 729 | constexpr ranges::move_result<borrowed_iterator_t<R>, O> |
| 730 | ranges::move(R&& r, O result); // since C++20 |
| 731 | |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 732 | template<class I, class O1, class O2> |
| 733 | using partition_copy_result = in_out_out_result<I, O1, O2>; // since C++20 |
| 734 | |
| 735 | template<input_iterator I, sentinel_for<I> S, |
| 736 | weakly_incrementable O1, weakly_incrementable O2, |
| 737 | class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred> |
| 738 | requires indirectly_copyable<I, O1> && indirectly_copyable<I, O2> |
| 739 | constexpr partition_copy_result<I, O1, O2> |
| 740 | partition_copy(I first, S last, O1 out_true, O2 out_false, Pred pred, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 741 | Proj proj = {}); // since C++20 |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 742 | |
| 743 | template<input_range R, weakly_incrementable O1, weakly_incrementable O2, |
| 744 | class Proj = identity, |
| 745 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 746 | requires indirectly_copyable<iterator_t<R>, O1> && |
| 747 | indirectly_copyable<iterator_t<R>, O2> |
| 748 | constexpr partition_copy_result<borrowed_iterator_t<R>, O1, O2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 749 | partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 750 | |
| 751 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 752 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 753 | constexpr I partition_point(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 754 | |
| 755 | template<forward_range R, class Proj = identity, |
| 756 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 757 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 758 | partition_point(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 759 | |
Hui Xie | 25607d1 | 2022-06-26 15:13:43 | [diff] [blame] | 760 | template<class I1, class I2, class O> |
| 761 | using merge_result = in_in_out_result<I1, I2, O>; // since C++20 |
| 762 | |
| 763 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 764 | weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, |
| 765 | class Proj2 = identity> |
| 766 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 767 | constexpr merge_result<I1, I2, O> |
| 768 | merge(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
| 769 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 770 | |
| 771 | template<input_range R1, input_range R2, weakly_incrementable O, class Comp = ranges::less, |
| 772 | class Proj1 = identity, class Proj2 = identity> |
| 773 | requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2> |
| 774 | constexpr merge_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> |
| 775 | merge(R1&& r1, R2&& r2, O result, |
| 776 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 2c3bbac | 2022-06-23 10:23:41 | [diff] [blame] | 777 | |
Nikolas Klauser | f8cbe3cdf | 2022-07-06 12:03:00 | [diff] [blame] | 778 | template<permutable I, sentinel_for<I> S, class T, class Proj = identity> |
| 779 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 780 | constexpr subrange<I> ranges::remove(I first, S last, const T& value, Proj proj = {}); // since C++20 |
| 781 | |
| 782 | template<forward_range R, class T, class Proj = identity> |
| 783 | requires permutable<iterator_t<R>> && |
| 784 | indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 785 | constexpr borrowed_subrange_t<R> |
| 786 | ranges::remove(R&& r, const T& value, Proj proj = {}); // since C++20 |
| 787 | |
| 788 | template<permutable I, sentinel_for<I> S, class Proj = identity, |
| 789 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 790 | constexpr subrange<I> ranges::remove_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 791 | |
| 792 | template<forward_range R, class Proj = identity, |
| 793 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 794 | requires permutable<iterator_t<R>> |
| 795 | constexpr borrowed_subrange_t<R> |
| 796 | ranges::remove_if(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 797 | |
Hui Xie | 1cdec6c | 2022-06-26 15:13:43 | [diff] [blame] | 798 | template<class I, class O> |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 799 | using set_difference_result = in_out_result<I, O>; // since C++20 |
Hui Xie | 1cdec6c | 2022-06-26 15:13:43 | [diff] [blame] | 800 | |
| 801 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 802 | weakly_incrementable O, class Comp = ranges::less, |
| 803 | class Proj1 = identity, class Proj2 = identity> |
| 804 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 805 | constexpr set_difference_result<I1, O> |
| 806 | set_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
| 807 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 808 | |
| 809 | template<input_range R1, input_range R2, weakly_incrementable O, |
| 810 | class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> |
| 811 | requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2> |
| 812 | constexpr set_difference_result<borrowed_iterator_t<R1>, O> |
| 813 | set_difference(R1&& r1, R2&& r2, O result, |
| 814 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | f8cbe3cdf | 2022-07-06 12:03:00 | [diff] [blame] | 815 | |
Hui Xie | 96b674f | 2022-07-08 14:21:40 | [diff] [blame] | 816 | template<class I1, class I2, class O> |
| 817 | using set_intersection_result = in_in_out_result<I1, I2, O>; // since C++20 |
| 818 | |
| 819 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 820 | weakly_incrementable O, class Comp = ranges::less, |
| 821 | class Proj1 = identity, class Proj2 = identity> |
| 822 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 823 | constexpr set_intersection_result<I1, I2, O> |
| 824 | set_intersection(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
| 825 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 826 | |
| 827 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 828 | weakly_incrementable O, class Comp = ranges::less, |
| 829 | class Proj1 = identity, class Proj2 = identity> |
| 830 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 831 | constexpr set_intersection_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> |
| 832 | set_intersection(R1&& r1, R2&& r2, O result, |
| 833 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 834 | |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 835 | template <class _InIter, class _OutIter> |
| 836 | using reverse_copy_result = in_out_result<_InIter, _OutIter>; // since C++20 |
| 837 | |
| 838 | template<bidirectional_iterator I, sentinel_for<I> S, weakly_incrementable O> |
| 839 | requires indirectly_copyable<I, O> |
| 840 | constexpr ranges::reverse_copy_result<I, O> |
| 841 | ranges::reverse_copy(I first, S last, O result); // since C++20 |
| 842 | |
| 843 | template<bidirectional_range R, weakly_incrementable O> |
| 844 | requires indirectly_copyable<iterator_t<R>, O> |
| 845 | constexpr ranges::reverse_copy_result<borrowed_iterator_t<R>, O> |
| 846 | ranges::reverse_copy(R&& r, O result); // since C++20 |
| 847 | |
Konstantin Varlamov | 36c746c | 2022-08-03 23:04:14 | [diff] [blame] | 848 | template<permutable I, sentinel_for<I> S> |
| 849 | constexpr subrange<I> rotate(I first, I middle, S last); // since C++20 |
| 850 | |
| 851 | template<forward_range R> |
| 852 | requires permutable<iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 853 | constexpr borrowed_subrange_t<R> rotate(R&& r, iterator_t<R> middle); // since C++20 |
Konstantin Varlamov | 36c746c | 2022-08-03 23:04:14 | [diff] [blame] | 854 | |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 855 | template <class _InIter, class _OutIter> |
| 856 | using rotate_copy_result = in_out_result<_InIter, _OutIter>; // since C++20 |
| 857 | |
| 858 | template<forward_iterator I, sentinel_for<I> S, weakly_incrementable O> |
| 859 | requires indirectly_copyable<I, O> |
| 860 | constexpr ranges::rotate_copy_result<I, O> |
| 861 | ranges::rotate_copy(I first, I middle, S last, O result); // since C++20 |
| 862 | |
| 863 | template<forward_range R, weakly_incrementable O> |
| 864 | requires indirectly_copyable<iterator_t<R>, O> |
| 865 | constexpr ranges::rotate_copy_result<borrowed_iterator_t<R>, O> |
| 866 | ranges::rotate_copy(R&& r, iterator_t<R> middle, O result); // since C++20 |
| 867 | |
Konstantin Varlamov | 6bdb642 | 2022-08-03 05:33:12 | [diff] [blame] | 868 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Gen> |
| 869 | requires (forward_iterator<I> || random_access_iterator<O>) && |
| 870 | indirectly_copyable<I, O> && |
| 871 | uniform_random_bit_generator<remove_reference_t<Gen>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 872 | O sample(I first, S last, O out, iter_difference_t<I> n, Gen&& g); // since C++20 |
Konstantin Varlamov | 6bdb642 | 2022-08-03 05:33:12 | [diff] [blame] | 873 | |
| 874 | template<input_range R, weakly_incrementable O, class Gen> |
| 875 | requires (forward_range<R> || random_access_iterator<O>) && |
| 876 | indirectly_copyable<iterator_t<R>, O> && |
| 877 | uniform_random_bit_generator<remove_reference_t<Gen>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 878 | O sample(R&& r, O out, range_difference_t<R> n, Gen&& g); // since C++20 |
Konstantin Varlamov | 6bdb642 | 2022-08-03 05:33:12 | [diff] [blame] | 879 | |
Konstantin Varlamov | 14cf74d | 2022-07-22 16:58:56 | [diff] [blame] | 880 | template<random_access_iterator I, sentinel_for<I> S, class Gen> |
| 881 | requires permutable<I> && |
| 882 | uniform_random_bit_generator<remove_reference_t<Gen>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 883 | I shuffle(I first, S last, Gen&& g); // since C++20 |
Konstantin Varlamov | 14cf74d | 2022-07-22 16:58:56 | [diff] [blame] | 884 | |
| 885 | template<random_access_range R, class Gen> |
| 886 | requires permutable<iterator_t<R>> && |
| 887 | uniform_random_bit_generator<remove_reference_t<Gen>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 888 | borrowed_iterator_t<R> shuffle(R&& r, Gen&& g); // since C++20 |
Konstantin Varlamov | 14cf74d | 2022-07-22 16:58:56 | [diff] [blame] | 889 | |
Nikolas Klauser | 101d1e9 | 2022-07-13 16:07:26 | [diff] [blame] | 890 | template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, |
Nikolas Klauser | 4038c85 | 2022-08-04 17:54:13 | [diff] [blame] | 891 | sentinel_for<I2> S2, class Proj1 = identity, class Proj2 = identity, |
| 892 | indirect_equivalence_relation<projected<I1, Proj1>, |
| 893 | projected<I2, Proj2>> Pred = ranges::equal_to> |
| 894 | constexpr bool ranges::is_permutation(I1 first1, S1 last1, I2 first2, S2 last2, |
| 895 | Pred pred = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 896 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 4038c85 | 2022-08-04 17:54:13 | [diff] [blame] | 897 | |
| 898 | template<forward_range R1, forward_range R2, |
| 899 | class Proj1 = identity, class Proj2 = identity, |
| 900 | indirect_equivalence_relation<projected<iterator_t<R1>, Proj1>, |
| 901 | projected<iterator_t<R2>, Proj2>> Pred = ranges::equal_to> |
| 902 | constexpr bool ranges::is_permutation(R1&& r1, R2&& r2, Pred pred = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 903 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 4038c85 | 2022-08-04 17:54:13 | [diff] [blame] | 904 | |
| 905 | template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, |
Nikolas Klauser | 101d1e9 | 2022-07-13 16:07:26 | [diff] [blame] | 906 | sentinel_for<I2> S2, class Pred = ranges::equal_to, |
| 907 | class Proj1 = identity, class Proj2 = identity> |
| 908 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 909 | constexpr subrange<I1> |
| 910 | ranges::search(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, |
| 911 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 912 | |
| 913 | template<forward_range R1, forward_range R2, class Pred = ranges::equal_to, |
| 914 | class Proj1 = identity, class Proj2 = identity> |
| 915 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 916 | constexpr borrowed_subrange_t<R1> |
| 917 | ranges::search(R1&& r1, R2&& r2, Pred pred = {}, |
| 918 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 919 | |
| 920 | template<forward_iterator I, sentinel_for<I> S, class T, |
| 921 | class Pred = ranges::equal_to, class Proj = identity> |
| 922 | requires indirectly_comparable<I, const T*, Pred, Proj> |
| 923 | constexpr subrange<I> |
| 924 | ranges::search_n(I first, S last, iter_difference_t<I> count, |
| 925 | const T& value, Pred pred = {}, Proj proj = {}); // since C++20 |
| 926 | |
| 927 | template<forward_range R, class T, class Pred = ranges::equal_to, |
| 928 | class Proj = identity> |
| 929 | requires indirectly_comparable<iterator_t<R>, const T*, Pred, Proj> |
| 930 | constexpr borrowed_subrange_t<R> |
| 931 | ranges::search_n(R&& r, range_difference_t<R> count, |
| 932 | const T& value, Pred pred = {}, Proj proj = {}); // since C++20 |
| 933 | |
Christopher Di Bella | 3903438 | 2023-12-20 05:57:50 | [diff] [blame] | 934 | template<input_iterator I, sentinel_for<I> S, class T, |
| 935 | indirectly-binary-left-foldable<T, I> F> |
| 936 | constexpr auto ranges::fold_left(I first, S last, T init, F f); // since C++23 |
| 937 | |
| 938 | template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F> |
| 939 | constexpr auto fold_left(R&& r, T init, F f); // since C++23 |
| 940 | |
| 941 | template<class I, class T> |
| 942 | using fold_left_with_iter_result = in_value_result<I, T>; // since C++23 |
| 943 | |
| 944 | template<input_iterator I, sentinel_for<I> S, class T, |
| 945 | indirectly-binary-left-foldable<T, I> F> |
| 946 | constexpr see below fold_left_with_iter(I first, S last, T init, F f); // since C++23 |
| 947 | |
| 948 | template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F> |
| 949 | constexpr see below fold_left_with_iter(R&& r, T init, F f); // since C++23 |
| 950 | |
Nikolas Klauser | 101d1e9 | 2022-07-13 16:07:26 | [diff] [blame] | 951 | template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2, |
| 952 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 953 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 954 | constexpr subrange<I1> |
| 955 | ranges::find_end(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, |
| 956 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 957 | |
| 958 | template<forward_range R1, forward_range R2, |
| 959 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 960 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 961 | constexpr borrowed_subrange_t<R1> |
| 962 | ranges::find_end(R1&& r1, R2&& r2, Pred pred = {}, |
| 963 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 964 | |
Hui Xie | a5c0638 | 2022-07-11 22:39:59 | [diff] [blame] | 965 | template<class I1, class I2, class O> |
| 966 | using set_symmetric_difference_result = in_in_out_result<I1, I2, O>; // since C++20 |
| 967 | |
| 968 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 969 | weakly_incrementable O, class Comp = ranges::less, |
| 970 | class Proj1 = identity, class Proj2 = identity> |
| 971 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 972 | constexpr set_symmetric_difference_result<I1, I2, O> |
| 973 | set_symmetric_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
| 974 | Comp comp = {}, Proj1 proj1 = {}, |
| 975 | Proj2 proj2 = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 976 | |
Hui Xie | a5c0638 | 2022-07-11 22:39:59 | [diff] [blame] | 977 | template<input_range R1, input_range R2, weakly_incrementable O, |
| 978 | class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> |
| 979 | requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2> |
| 980 | constexpr set_symmetric_difference_result<borrowed_iterator_t<R1>, |
| 981 | borrowed_iterator_t<R2>, O> |
| 982 | set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {}, |
| 983 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Hui Xie | 0f6364b8 | 2022-07-14 19:35:15 | [diff] [blame] | 984 | |
| 985 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 986 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> |
| 987 | constexpr subrange<I> |
| 988 | equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 989 | |
Hui Xie | 0f6364b8 | 2022-07-14 19:35:15 | [diff] [blame] | 990 | template<forward_range R, class T, class Proj = identity, |
| 991 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 992 | ranges::less> |
| 993 | constexpr borrowed_subrange_t<R> |
| 994 | equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 995 | |
Hui Xie | 3151b95 | 2022-07-13 16:20:22 | [diff] [blame] | 996 | template<class I1, class I2, class O> |
| 997 | using set_union_result = in_in_out_result<I1, I2, O>; // since C++20 |
| 998 | |
| 999 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 1000 | weakly_incrementable O, class Comp = ranges::less, |
| 1001 | class Proj1 = identity, class Proj2 = identity> |
| 1002 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 1003 | constexpr set_union_result<I1, I2, O> |
| 1004 | set_union(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, |
| 1005 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 1006 | |
| 1007 | template<input_range R1, input_range R2, weakly_incrementable O, |
| 1008 | class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> |
| 1009 | requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2> |
| 1010 | constexpr set_union_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> |
| 1011 | set_union(R1&& r1, R2&& r2, O result, Comp comp = {}, |
| 1012 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Hui Xie | c559964 | 2022-07-19 19:54:35 | [diff] [blame] | 1013 | |
| 1014 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 1015 | class Proj1 = identity, class Proj2 = identity, |
| 1016 | indirect_strict_weak_order<projected<I1, Proj1>, projected<I2, Proj2>> Comp = |
| 1017 | ranges::less> |
| 1018 | constexpr bool includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1019 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 1020 | |
Hui Xie | c559964 | 2022-07-19 19:54:35 | [diff] [blame] | 1021 | template<input_range R1, input_range R2, class Proj1 = identity, |
| 1022 | class Proj2 = identity, |
| 1023 | indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>, |
| 1024 | projected<iterator_t<R2>, Proj2>> Comp = ranges::less> |
| 1025 | constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1026 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 1027 | |
| 1028 | template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 1029 | class Proj = identity> |
| 1030 | requires sortable<I, Comp, Proj> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1031 | I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 1032 | |
| 1033 | template<bidirectional_range R, class Comp = ranges::less, class Proj = identity> |
| 1034 | requires sortable<iterator_t<R>, Comp, Proj> |
| 1035 | borrowed_iterator_t<R> |
| 1036 | inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1037 | Proj proj = {}); // since C++20 |
Hui Xie | 72f57e3 | 2022-07-23 00:44:25 | [diff] [blame] | 1038 | |
| 1039 | template<permutable I, sentinel_for<I> S, class Proj = identity, |
| 1040 | indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1041 | constexpr subrange<I> unique(I first, S last, C comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 72f57e3 | 2022-07-23 00:44:25 | [diff] [blame] | 1042 | |
| 1043 | template<forward_range R, class Proj = identity, |
| 1044 | indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to> |
| 1045 | requires permutable<iterator_t<R>> |
| 1046 | constexpr borrowed_subrange_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1047 | unique(R&& r, C comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 72f57e3 | 2022-07-23 00:44:25 | [diff] [blame] | 1048 | |
| 1049 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Proj = identity, |
| 1050 | indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to> |
| 1051 | requires indirectly_copyable<I, O> && |
| 1052 | (forward_iterator<I> || |
| 1053 | (input_iterator<O> && same_as<iter_value_t<I>, iter_value_t<O>>) || |
| 1054 | indirectly_copyable_storable<I, O>) |
| 1055 | constexpr unique_copy_result<I, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1056 | unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 72f57e3 | 2022-07-23 00:44:25 | [diff] [blame] | 1057 | |
| 1058 | template<input_range R, weakly_incrementable O, class Proj = identity, |
| 1059 | indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to> |
| 1060 | requires indirectly_copyable<iterator_t<R>, O> && |
| 1061 | (forward_iterator<iterator_t<R>> || |
| 1062 | (input_iterator<O> && same_as<range_value_t<R>, iter_value_t<O>>) || |
| 1063 | indirectly_copyable_storable<iterator_t<R>, O>) |
| 1064 | constexpr unique_copy_result<borrowed_iterator_t<R>, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1065 | unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1066 | |
| 1067 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1068 | using remove_copy_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1069 | |
| 1070 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class T, |
| 1071 | class Proj = identity> |
| 1072 | indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 1073 | constexpr remove_copy_result<I, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1074 | remove_copy(I first, S last, O result, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1075 | |
| 1076 | template<input_range R, weakly_incrementable O, class T, class Proj = identity> |
| 1077 | requires indirectly_copyable<iterator_t<R>, O> && |
| 1078 | indirect_binary_predicate<ranges::equal_to, |
| 1079 | projected<iterator_t<R>, Proj>, const T*> |
| 1080 | constexpr remove_copy_result<borrowed_iterator_t<R>, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1081 | remove_copy(R&& r, O result, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1082 | |
| 1083 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1084 | using remove_copy_if_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1085 | |
| 1086 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, |
| 1087 | class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred> |
| 1088 | requires indirectly_copyable<I, O> |
| 1089 | constexpr remove_copy_if_result<I, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1090 | remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1091 | |
| 1092 | template<input_range R, weakly_incrementable O, class Proj = identity, |
| 1093 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 1094 | requires indirectly_copyable<iterator_t<R>, O> |
| 1095 | constexpr remove_copy_if_result<borrowed_iterator_t<R>, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1096 | remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1097 | |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1098 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1099 | using replace_copy_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1100 | |
| 1101 | template<input_iterator I, sentinel_for<I> S, class T1, class T2, |
| 1102 | output_iterator<const T2&> O, class Proj = identity> |
| 1103 | requires indirectly_copyable<I, O> && |
| 1104 | indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*> |
| 1105 | constexpr replace_copy_result<I, O> |
| 1106 | replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1107 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1108 | |
| 1109 | template<input_range R, class T1, class T2, output_iterator<const T2&> O, |
| 1110 | class Proj = identity> |
| 1111 | requires indirectly_copyable<iterator_t<R>, O> && |
| 1112 | indirect_binary_predicate<ranges::equal_to, |
| 1113 | projected<iterator_t<R>, Proj>, const T1*> |
| 1114 | constexpr replace_copy_result<borrowed_iterator_t<R>, O> |
| 1115 | replace_copy(R&& r, O result, const T1& old_value, const T2& new_value, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1116 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1117 | |
| 1118 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1119 | using replace_copy_if_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1120 | |
| 1121 | template<input_iterator I, sentinel_for<I> S, class T, output_iterator<const T&> O, |
| 1122 | class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred> |
| 1123 | requires indirectly_copyable<I, O> |
| 1124 | constexpr replace_copy_if_result<I, O> |
| 1125 | replace_copy_if(I first, S last, O result, Pred pred, const T& new_value, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1126 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1127 | |
| 1128 | template<input_range R, class T, output_iterator<const T&> O, class Proj = identity, |
| 1129 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 1130 | requires indirectly_copyable<iterator_t<R>, O> |
| 1131 | constexpr replace_copy_if_result<borrowed_iterator_t<R>, O> |
| 1132 | replace_copy_if(R&& r, O result, Pred pred, const T& new_value, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1133 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1134 | |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1135 | template<class I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1136 | using prev_permutation_result = in_found_result<I>; // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1137 | |
| 1138 | template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 1139 | class Proj = identity> |
| 1140 | requires sortable<I, Comp, Proj> |
| 1141 | constexpr ranges::prev_permutation_result<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1142 | ranges::prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1143 | |
| 1144 | template<bidirectional_range R, class Comp = ranges::less, |
| 1145 | class Proj = identity> |
| 1146 | requires sortable<iterator_t<R>, Comp, Proj> |
| 1147 | constexpr ranges::prev_permutation_result<borrowed_iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1148 | ranges::prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1149 | |
| 1150 | template<class I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1151 | using next_permutation_result = in_found_result<I>; // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1152 | |
| 1153 | template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 1154 | class Proj = identity> |
| 1155 | requires sortable<I, Comp, Proj> |
| 1156 | constexpr ranges::next_permutation_result<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1157 | ranges::next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1158 | |
| 1159 | template<bidirectional_range R, class Comp = ranges::less, |
| 1160 | class Proj = identity> |
| 1161 | requires sortable<iterator_t<R>, Comp, Proj> |
| 1162 | constexpr ranges::next_permutation_result<borrowed_iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1163 | ranges::next_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1164 | |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 1165 | } |
| 1166 | |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1167 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 1168 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1169 | all_of(InputIterator first, InputIterator last, Predicate pred); |
| 1170 | |
| 1171 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 1172 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1173 | any_of(InputIterator first, InputIterator last, Predicate pred); |
| 1174 | |
| 1175 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 1176 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1177 | none_of(InputIterator first, InputIterator last, Predicate pred); |
| 1178 | |
| 1179 | template <class InputIterator, class Function> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1180 | constexpr Function // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1181 | for_each(InputIterator first, InputIterator last, Function f); |
| 1182 | |
Marshall Clow | d5c65ff | 2017-05-25 02:29:54 | [diff] [blame] | 1183 | template<class InputIterator, class Size, class Function> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1184 | constexpr InputIterator // constexpr in C++20 |
| 1185 | for_each_n(InputIterator first, Size n, Function f); // C++17 |
Marshall Clow | d5c65ff | 2017-05-25 02:29:54 | [diff] [blame] | 1186 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1187 | template <class InputIterator, class T> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1188 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1189 | find(InputIterator first, InputIterator last, const T& value); |
| 1190 | |
| 1191 | template <class InputIterator, class Predicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1192 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1193 | find_if(InputIterator first, InputIterator last, Predicate pred); |
| 1194 | |
| 1195 | template<class InputIterator, class Predicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1196 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1197 | find_if_not(InputIterator first, InputIterator last, Predicate pred); |
| 1198 | |
| 1199 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1200 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1201 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1202 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 1203 | |
| 1204 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1205 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1206 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1207 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 1208 | |
| 1209 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1210 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1211 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1212 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 1213 | |
| 1214 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1215 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1216 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1217 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 1218 | |
| 1219 | template <class ForwardIterator> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1220 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1221 | adjacent_find(ForwardIterator first, ForwardIterator last); |
| 1222 | |
| 1223 | template <class ForwardIterator, class BinaryPredicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1224 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1225 | adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 1226 | |
| 1227 | template <class InputIterator, class T> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 1228 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1229 | count(InputIterator first, InputIterator last, const T& value); |
| 1230 | |
| 1231 | template <class InputIterator, class Predicate> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 1232 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1233 | count_if(InputIterator first, InputIterator last, Predicate pred); |
| 1234 | |
| 1235 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1236 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1237 | mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 1238 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1239 | template <class InputIterator1, class InputIterator2> |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1240 | constexpr pair<InputIterator1, InputIterator2> |
Aditya Kumar | 331fb80 | 2016-08-25 11:52:38 | [diff] [blame] | 1241 | mismatch(InputIterator1 first1, InputIterator1 last1, |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1242 | InputIterator2 first2, InputIterator2 last2); // since C++14, constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1243 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1244 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1245 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1246 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 1247 | InputIterator2 first2, BinaryPredicate pred); |
| 1248 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1249 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1250 | constexpr pair<InputIterator1, InputIterator2> |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1251 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 1252 | InputIterator2 first2, InputIterator2 last2, |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1253 | BinaryPredicate pred); // since C++14, constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1254 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1255 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1256 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1257 | equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 1258 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1259 | template <class InputIterator1, class InputIterator2> |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1260 | constexpr bool |
Aditya Kumar | 331fb80 | 2016-08-25 11:52:38 | [diff] [blame] | 1261 | equal(InputIterator1 first1, InputIterator1 last1, |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1262 | InputIterator2 first2, InputIterator2 last2); // since C++14, constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1263 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1264 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1265 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1266 | equal(InputIterator1 first1, InputIterator1 last1, |
| 1267 | InputIterator2 first2, BinaryPredicate pred); |
| 1268 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1269 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1270 | constexpr bool |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1271 | equal(InputIterator1 first1, InputIterator1 last1, |
| 1272 | InputIterator2 first2, InputIterator2 last2, |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1273 | BinaryPredicate pred); // since C++14, constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1274 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1275 | template<class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1276 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1277 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1278 | ForwardIterator2 first2); |
| 1279 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1280 | template<class ForwardIterator1, class ForwardIterator2> |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1281 | constexpr bool |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1282 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1283 | ForwardIterator2 first2, ForwardIterator2 last2); // since C++14, constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1284 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1285 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1286 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1287 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1288 | ForwardIterator2 first2, BinaryPredicate pred); |
| 1289 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1290 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1291 | constexpr bool |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1292 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1293 | ForwardIterator2 first2, ForwardIterator2 last2, |
Louis Dionne | 5366bf5 | 2024-10-01 16:59:36 | [diff] [blame] | 1294 | BinaryPredicate pred); // since C++14, constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1295 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1296 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 1297 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1298 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1299 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 1300 | |
| 1301 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 1302 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1303 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1304 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 1305 | |
| 1306 | template <class ForwardIterator, class Size, class T> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 1307 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1308 | search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); |
| 1309 | |
| 1310 | template <class ForwardIterator, class Size, class T, class BinaryPredicate> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 1311 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1312 | search_n(ForwardIterator first, ForwardIterator last, |
| 1313 | Size count, const T& value, BinaryPredicate pred); |
| 1314 | |
| 1315 | template <class InputIterator, class OutputIterator> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 1316 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1317 | copy(InputIterator first, InputIterator last, OutputIterator result); |
| 1318 | |
| 1319 | template<class InputIterator, class OutputIterator, class Predicate> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 1320 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1321 | copy_if(InputIterator first, InputIterator last, |
| 1322 | OutputIterator result, Predicate pred); |
| 1323 | |
| 1324 | template<class InputIterator, class Size, class OutputIterator> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 1325 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1326 | copy_n(InputIterator first, Size n, OutputIterator result); |
| 1327 | |
| 1328 | template <class BidirectionalIterator1, class BidirectionalIterator2> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 1329 | constexpr BidirectionalIterator2 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1330 | copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, |
| 1331 | BidirectionalIterator2 result); |
| 1332 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 1333 | // [alg.move], move |
| 1334 | template<class InputIterator, class OutputIterator> |
| 1335 | constexpr OutputIterator move(InputIterator first, InputIterator last, |
| 1336 | OutputIterator result); |
| 1337 | |
| 1338 | template<class BidirectionalIterator1, class BidirectionalIterator2> |
| 1339 | constexpr BidirectionalIterator2 |
| 1340 | move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, |
| 1341 | BidirectionalIterator2 result); |
| 1342 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1343 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1344 | constexpr ForwardIterator2 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1345 | swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); |
| 1346 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 1347 | namespace ranges { |
| 1348 | template<class I1, class I2> |
| 1349 | using swap_ranges_result = in_in_result<I1, I2>; |
| 1350 | |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 1351 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2> |
| 1352 | requires indirectly_swappable<I1, I2> |
| 1353 | constexpr ranges::swap_ranges_result<I1, I2> |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 1354 | swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2); |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 1355 | |
| 1356 | template<input_range R1, input_range R2> |
| 1357 | requires indirectly_swappable<iterator_t<R1>, iterator_t<R2>> |
| 1358 | constexpr ranges::swap_ranges_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 1359 | swap_ranges(R1&& r1, R2&& r2); |
| 1360 | } |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 1361 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1362 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1363 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1364 | iter_swap(ForwardIterator1 a, ForwardIterator2 b); |
| 1365 | |
| 1366 | template <class InputIterator, class OutputIterator, class UnaryOperation> |
Marshall Clow | 99894b6 | 2018-01-19 17:45:39 | [diff] [blame] | 1367 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1368 | transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op); |
| 1369 | |
| 1370 | template <class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation> |
Marshall Clow | 99894b6 | 2018-01-19 17:45:39 | [diff] [blame] | 1371 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1372 | transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, |
| 1373 | OutputIterator result, BinaryOperation binary_op); |
| 1374 | |
| 1375 | template <class ForwardIterator, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 1376 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1377 | replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value); |
| 1378 | |
| 1379 | template <class ForwardIterator, class Predicate, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 1380 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1381 | replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value); |
| 1382 | |
| 1383 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 1384 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1385 | replace_copy(InputIterator first, InputIterator last, OutputIterator result, |
| 1386 | const T& old_value, const T& new_value); |
| 1387 | |
| 1388 | template <class InputIterator, class OutputIterator, class Predicate, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 1389 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1390 | replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value); |
| 1391 | |
| 1392 | template <class ForwardIterator, class T> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 1393 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1394 | fill(ForwardIterator first, ForwardIterator last, const T& value); |
| 1395 | |
| 1396 | template <class OutputIterator, class Size, class T> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 1397 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1398 | fill_n(OutputIterator first, Size n, const T& value); |
| 1399 | |
| 1400 | template <class ForwardIterator, class Generator> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 1401 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1402 | generate(ForwardIterator first, ForwardIterator last, Generator gen); |
| 1403 | |
| 1404 | template <class OutputIterator, class Size, class Generator> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 1405 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1406 | generate_n(OutputIterator first, Size n, Generator gen); |
| 1407 | |
| 1408 | template <class ForwardIterator, class T> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1409 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1410 | remove(ForwardIterator first, ForwardIterator last, const T& value); |
| 1411 | |
| 1412 | template <class ForwardIterator, class Predicate> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1413 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1414 | remove_if(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 1415 | |
| 1416 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1417 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1418 | remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); |
| 1419 | |
| 1420 | template <class InputIterator, class OutputIterator, class Predicate> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1421 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1422 | remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); |
| 1423 | |
| 1424 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1425 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1426 | unique(ForwardIterator first, ForwardIterator last); |
| 1427 | |
| 1428 | template <class ForwardIterator, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1429 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1430 | unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 1431 | |
| 1432 | template <class InputIterator, class OutputIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1433 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1434 | unique_copy(InputIterator first, InputIterator last, OutputIterator result); |
| 1435 | |
| 1436 | template <class InputIterator, class OutputIterator, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1437 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1438 | unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred); |
| 1439 | |
| 1440 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1441 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1442 | reverse(BidirectionalIterator first, BidirectionalIterator last); |
| 1443 | |
| 1444 | template <class BidirectionalIterator, class OutputIterator> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1445 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1446 | reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); |
| 1447 | |
| 1448 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1449 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1450 | rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last); |
| 1451 | |
| 1452 | template <class ForwardIterator, class OutputIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1453 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1454 | rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result); |
| 1455 | |
| 1456 | template <class RandomAccessIterator> |
| 1457 | void |
Marshall Clow | 0f37a41 | 2017-03-23 13:43:37 | [diff] [blame] | 1458 | random_shuffle(RandomAccessIterator first, RandomAccessIterator last); // deprecated in C++14, removed in C++17 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1459 | |
| 1460 | template <class RandomAccessIterator, class RandomNumberGenerator> |
| 1461 | void |
Marshall Clow | 06965c1 | 2014-03-03 06:14:19 | [diff] [blame] | 1462 | random_shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Marshall Clow | 0f37a41 | 2017-03-23 13:43:37 | [diff] [blame] | 1463 | RandomNumberGenerator& rand); // deprecated in C++14, removed in C++17 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1464 | |
Eric Fiselier | e715470 | 2016-08-28 22:14:37 | [diff] [blame] | 1465 | template<class PopulationIterator, class SampleIterator, |
| 1466 | class Distance, class UniformRandomBitGenerator> |
| 1467 | SampleIterator sample(PopulationIterator first, PopulationIterator last, |
| 1468 | SampleIterator out, Distance n, |
| 1469 | UniformRandomBitGenerator&& g); // C++17 |
| 1470 | |
Howard Hinnant | f9d540b | 2010-05-26 17:49:34 | [diff] [blame] | 1471 | template<class RandomAccessIterator, class UniformRandomNumberGenerator> |
| 1472 | void shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Howard Hinnant | fb34010 | 2010-11-18 01:47:02 | [diff] [blame] | 1473 | UniformRandomNumberGenerator&& g); |
Howard Hinnant | f9d540b | 2010-05-26 17:49:34 | [diff] [blame] | 1474 | |
Arthur O'Dwyer | 3fbd3ea | 2020-12-26 06:39:03 | [diff] [blame] | 1475 | template<class ForwardIterator> |
| 1476 | constexpr ForwardIterator |
| 1477 | shift_left(ForwardIterator first, ForwardIterator last, |
| 1478 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 1479 | |
| 1480 | template<class ForwardIterator> |
| 1481 | constexpr ForwardIterator |
| 1482 | shift_right(ForwardIterator first, ForwardIterator last, |
| 1483 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 1484 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1485 | template <class InputIterator, class Predicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1486 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1487 | is_partitioned(InputIterator first, InputIterator last, Predicate pred); |
| 1488 | |
| 1489 | template <class ForwardIterator, class Predicate> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1490 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1491 | partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 1492 | |
| 1493 | template <class InputIterator, class OutputIterator1, |
| 1494 | class OutputIterator2, class Predicate> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1495 | constexpr pair<OutputIterator1, OutputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1496 | partition_copy(InputIterator first, InputIterator last, |
| 1497 | OutputIterator1 out_true, OutputIterator2 out_false, |
| 1498 | Predicate pred); |
| 1499 | |
| 1500 | template <class ForwardIterator, class Predicate> |
| 1501 | ForwardIterator |
| 1502 | stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 1503 | |
| 1504 | template<class ForwardIterator, class Predicate> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1505 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1506 | partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 1507 | |
| 1508 | template <class ForwardIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1509 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1510 | is_sorted(ForwardIterator first, ForwardIterator last); |
| 1511 | |
| 1512 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1513 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1514 | is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); |
| 1515 | |
| 1516 | template<class ForwardIterator> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 1517 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1518 | is_sorted_until(ForwardIterator first, ForwardIterator last); |
| 1519 | |
| 1520 | template <class ForwardIterator, class Compare> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 1521 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1522 | is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); |
| 1523 | |
| 1524 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 493f140 | 2020-12-20 20:21:42 | [diff] [blame] | 1525 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1526 | sort(RandomAccessIterator first, RandomAccessIterator last); |
| 1527 | |
| 1528 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 493f140 | 2020-12-20 20:21:42 | [diff] [blame] | 1529 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1530 | sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1531 | |
| 1532 | template <class RandomAccessIterator> |
| 1533 | void |
| 1534 | stable_sort(RandomAccessIterator first, RandomAccessIterator last); |
| 1535 | |
| 1536 | template <class RandomAccessIterator, class Compare> |
| 1537 | void |
| 1538 | stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1539 | |
| 1540 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1541 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1542 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last); |
| 1543 | |
| 1544 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1545 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1546 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); |
| 1547 | |
| 1548 | template <class InputIterator, class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1549 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1550 | partial_sort_copy(InputIterator first, InputIterator last, |
| 1551 | RandomAccessIterator result_first, RandomAccessIterator result_last); |
| 1552 | |
| 1553 | template <class InputIterator, class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1554 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1555 | partial_sort_copy(InputIterator first, InputIterator last, |
| 1556 | RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp); |
| 1557 | |
| 1558 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5d95656 | 2021-02-04 23:12:52 | [diff] [blame] | 1559 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1560 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last); |
| 1561 | |
| 1562 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5d95656 | 2021-02-04 23:12:52 | [diff] [blame] | 1563 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1564 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); |
| 1565 | |
| 1566 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1567 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1568 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 1569 | |
| 1570 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1571 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1572 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 1573 | |
| 1574 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1575 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1576 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 1577 | |
| 1578 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1579 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1580 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 1581 | |
| 1582 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1583 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1584 | equal_range(ForwardIterator first, ForwardIterator last, const T& value); |
| 1585 | |
| 1586 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1587 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1588 | equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 1589 | |
| 1590 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1591 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1592 | binary_search(ForwardIterator first, ForwardIterator last, const T& value); |
| 1593 | |
| 1594 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1595 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1596 | binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 1597 | |
| 1598 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1599 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1600 | merge(InputIterator1 first1, InputIterator1 last1, |
| 1601 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1602 | |
| 1603 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1604 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1605 | merge(InputIterator1 first1, InputIterator1 last1, |
| 1606 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1607 | |
| 1608 | template <class BidirectionalIterator> |
| 1609 | void |
| 1610 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last); |
| 1611 | |
| 1612 | template <class BidirectionalIterator, class Compare> |
| 1613 | void |
| 1614 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp); |
| 1615 | |
| 1616 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1617 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1618 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 1619 | |
| 1620 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1621 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1622 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 1623 | |
| 1624 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1625 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1626 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 1627 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1628 | |
| 1629 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1630 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1631 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 1632 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1633 | |
| 1634 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1635 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1636 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 1637 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1638 | |
| 1639 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1640 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1641 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 1642 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1643 | |
| 1644 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1645 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1646 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 1647 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1648 | |
| 1649 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1650 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1651 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 1652 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1653 | |
| 1654 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1655 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1656 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 1657 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1658 | |
| 1659 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1660 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1661 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 1662 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1663 | |
| 1664 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1665 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1666 | push_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 1667 | |
| 1668 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1669 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1670 | push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1671 | |
| 1672 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1673 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1674 | pop_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 1675 | |
| 1676 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1677 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1678 | pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1679 | |
| 1680 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1681 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1682 | make_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 1683 | |
| 1684 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1685 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1686 | make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1687 | |
| 1688 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1689 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1690 | sort_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 1691 | |
| 1692 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1693 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1694 | sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1695 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1696 | template <class RandomAccessIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1697 | constexpr bool // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1698 | is_heap(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1699 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1700 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1701 | constexpr bool // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1702 | is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1703 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1704 | template <class RandomAccessIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1705 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1706 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1707 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1708 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1709 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1710 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1711 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1712 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1713 | constexpr ForwardIterator // constexpr in C++14 |
| 1714 | min_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1715 | |
| 1716 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1717 | constexpr ForwardIterator // constexpr in C++14 |
| 1718 | min_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1719 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1720 | template <class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1721 | constexpr const T& // constexpr in C++14 |
| 1722 | min(const T& a, const T& b); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1723 | |
| 1724 | template <class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1725 | constexpr const T& // constexpr in C++14 |
| 1726 | min(const T& a, const T& b, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1727 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1728 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1729 | constexpr T // constexpr in C++14 |
| 1730 | min(initializer_list<T> t); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1731 | |
| 1732 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1733 | constexpr T // constexpr in C++14 |
| 1734 | min(initializer_list<T> t, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1735 | |
Marshall Clow | 146c14a | 2016-03-07 22:43:49 | [diff] [blame] | 1736 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1737 | constexpr const T& clamp(const T& v, const T& lo, const T& hi); // C++17 |
Marshall Clow | 146c14a | 2016-03-07 22:43:49 | [diff] [blame] | 1738 | |
| 1739 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1740 | constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp); // C++17 |
Marshall Clow | 146c14a | 2016-03-07 22:43:49 | [diff] [blame] | 1741 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1742 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1743 | constexpr ForwardIterator // constexpr in C++14 |
| 1744 | max_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1745 | |
| 1746 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1747 | constexpr ForwardIterator // constexpr in C++14 |
| 1748 | max_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1749 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1750 | template <class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1751 | constexpr const T& // constexpr in C++14 |
| 1752 | max(const T& a, const T& b); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1753 | |
| 1754 | template <class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1755 | constexpr const T& // constexpr in C++14 |
| 1756 | max(const T& a, const T& b, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1757 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1758 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1759 | constexpr T // constexpr in C++14 |
| 1760 | max(initializer_list<T> t); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1761 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1762 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1763 | constexpr T // constexpr in C++14 |
| 1764 | max(initializer_list<T> t, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1765 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1766 | template<class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1767 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 1768 | minmax_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1769 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1770 | template<class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1771 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 1772 | minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1773 | |
| 1774 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1775 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 1776 | minmax(const T& a, const T& b); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1777 | |
| 1778 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1779 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 1780 | minmax(const T& a, const T& b, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1781 | |
| 1782 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1783 | constexpr pair<T, T> // constexpr in C++14 |
| 1784 | minmax(initializer_list<T> t); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1785 | |
| 1786 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1787 | constexpr pair<T, T> // constexpr in C++14 |
| 1788 | minmax(initializer_list<T> t, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1789 | |
| 1790 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1791 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1792 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 1793 | |
| 1794 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1795 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1796 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, |
| 1797 | InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 1798 | |
Adrian Vogelsgesang | 2a06757 | 2022-08-04 22:21:27 | [diff] [blame] | 1799 | template<class InputIterator1, class InputIterator2, class Cmp> |
| 1800 | constexpr auto |
| 1801 | lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1, |
| 1802 | InputIterator2 first2, InputIterator2 last2, |
| 1803 | Cmp comp) |
| 1804 | -> decltype(comp(*b1, *b2)); // since C++20 |
| 1805 | |
| 1806 | template<class InputIterator1, class InputIterator2> |
| 1807 | constexpr auto |
| 1808 | lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1, |
| 1809 | InputIterator2 first2, InputIterator2 last2); // since C++20 |
| 1810 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1811 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1812 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1813 | next_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 1814 | |
| 1815 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1816 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1817 | next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
| 1818 | |
| 1819 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1820 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1821 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 1822 | |
| 1823 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1824 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1825 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1826 | } // std |
| 1827 | |
| 1828 | */ |
| 1829 | |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 1830 | #if 0 |
| 1831 | #else // 0 |
| 1832 | # include <__config> |
Howard Hinnant | 5d1a701 | 2013-08-14 18:00:20 | [diff] [blame] | 1833 | |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 1834 | # include <__algorithm/adjacent_find.h> |
| 1835 | # include <__algorithm/all_of.h> |
| 1836 | # include <__algorithm/any_of.h> |
| 1837 | # include <__algorithm/binary_search.h> |
| 1838 | # include <__algorithm/copy.h> |
| 1839 | # include <__algorithm/copy_backward.h> |
| 1840 | # include <__algorithm/copy_if.h> |
| 1841 | # include <__algorithm/copy_n.h> |
| 1842 | # include <__algorithm/count.h> |
| 1843 | # include <__algorithm/count_if.h> |
| 1844 | # include <__algorithm/equal.h> |
| 1845 | # include <__algorithm/equal_range.h> |
| 1846 | # include <__algorithm/fill.h> |
| 1847 | # include <__algorithm/fill_n.h> |
| 1848 | # include <__algorithm/find.h> |
| 1849 | # include <__algorithm/find_end.h> |
| 1850 | # include <__algorithm/find_first_of.h> |
| 1851 | # include <__algorithm/find_if.h> |
| 1852 | # include <__algorithm/find_if_not.h> |
| 1853 | # include <__algorithm/for_each.h> |
| 1854 | # include <__algorithm/generate.h> |
| 1855 | # include <__algorithm/generate_n.h> |
| 1856 | # include <__algorithm/includes.h> |
| 1857 | # include <__algorithm/inplace_merge.h> |
| 1858 | # include <__algorithm/is_heap.h> |
| 1859 | # include <__algorithm/is_heap_until.h> |
| 1860 | # include <__algorithm/is_partitioned.h> |
| 1861 | # include <__algorithm/is_permutation.h> |
| 1862 | # include <__algorithm/is_sorted.h> |
| 1863 | # include <__algorithm/is_sorted_until.h> |
| 1864 | # include <__algorithm/iter_swap.h> |
| 1865 | # include <__algorithm/lexicographical_compare.h> |
| 1866 | # include <__algorithm/lower_bound.h> |
| 1867 | # include <__algorithm/make_heap.h> |
| 1868 | # include <__algorithm/max.h> |
| 1869 | # include <__algorithm/max_element.h> |
| 1870 | # include <__algorithm/merge.h> |
| 1871 | # include <__algorithm/min.h> |
| 1872 | # include <__algorithm/min_element.h> |
| 1873 | # include <__algorithm/minmax.h> |
| 1874 | # include <__algorithm/minmax_element.h> |
| 1875 | # include <__algorithm/mismatch.h> |
| 1876 | # include <__algorithm/move.h> |
| 1877 | # include <__algorithm/move_backward.h> |
| 1878 | # include <__algorithm/next_permutation.h> |
| 1879 | # include <__algorithm/none_of.h> |
| 1880 | # include <__algorithm/nth_element.h> |
| 1881 | # include <__algorithm/partial_sort.h> |
| 1882 | # include <__algorithm/partial_sort_copy.h> |
| 1883 | # include <__algorithm/partition.h> |
| 1884 | # include <__algorithm/partition_copy.h> |
| 1885 | # include <__algorithm/partition_point.h> |
| 1886 | # include <__algorithm/pop_heap.h> |
| 1887 | # include <__algorithm/prev_permutation.h> |
| 1888 | # include <__algorithm/push_heap.h> |
| 1889 | # include <__algorithm/remove.h> |
| 1890 | # include <__algorithm/remove_copy.h> |
| 1891 | # include <__algorithm/remove_copy_if.h> |
| 1892 | # include <__algorithm/remove_if.h> |
| 1893 | # include <__algorithm/replace.h> |
| 1894 | # include <__algorithm/replace_copy.h> |
| 1895 | # include <__algorithm/replace_copy_if.h> |
| 1896 | # include <__algorithm/replace_if.h> |
| 1897 | # include <__algorithm/reverse.h> |
| 1898 | # include <__algorithm/reverse_copy.h> |
| 1899 | # include <__algorithm/rotate.h> |
| 1900 | # include <__algorithm/rotate_copy.h> |
| 1901 | # include <__algorithm/search.h> |
| 1902 | # include <__algorithm/search_n.h> |
| 1903 | # include <__algorithm/set_difference.h> |
| 1904 | # include <__algorithm/set_intersection.h> |
| 1905 | # include <__algorithm/set_symmetric_difference.h> |
| 1906 | # include <__algorithm/set_union.h> |
| 1907 | # include <__algorithm/shuffle.h> |
| 1908 | # include <__algorithm/sort.h> |
| 1909 | # include <__algorithm/sort_heap.h> |
| 1910 | # include <__algorithm/stable_partition.h> |
| 1911 | # include <__algorithm/stable_sort.h> |
| 1912 | # include <__algorithm/swap_ranges.h> |
| 1913 | # include <__algorithm/transform.h> |
| 1914 | # include <__algorithm/unique.h> |
| 1915 | # include <__algorithm/unique_copy.h> |
| 1916 | # include <__algorithm/upper_bound.h> |
Eric Fiselier | c1bd919 | 2014-08-10 23:53:08 | [diff] [blame] | 1917 | |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 1918 | # if _LIBCPP_STD_VER >= 17 |
| 1919 | # include <__algorithm/clamp.h> |
| 1920 | # include <__algorithm/for_each_n.h> |
| 1921 | # include <__algorithm/pstl.h> |
| 1922 | # include <__algorithm/sample.h> |
| 1923 | # endif // _LIBCPP_STD_VER >= 17 |
Nikolas Klauser | d5c654b | 2024-04-14 13:52:56 | [diff] [blame] | 1924 | |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 1925 | # if _LIBCPP_STD_VER >= 20 |
| 1926 | # include <__algorithm/in_found_result.h> |
| 1927 | # include <__algorithm/in_fun_result.h> |
| 1928 | # include <__algorithm/in_in_out_result.h> |
| 1929 | # include <__algorithm/in_in_result.h> |
| 1930 | # include <__algorithm/in_out_out_result.h> |
| 1931 | # include <__algorithm/in_out_result.h> |
| 1932 | # include <__algorithm/lexicographical_compare_three_way.h> |
| 1933 | # include <__algorithm/min_max_result.h> |
| 1934 | # include <__algorithm/ranges_adjacent_find.h> |
| 1935 | # include <__algorithm/ranges_all_of.h> |
| 1936 | # include <__algorithm/ranges_any_of.h> |
| 1937 | # include <__algorithm/ranges_binary_search.h> |
| 1938 | # include <__algorithm/ranges_clamp.h> |
| 1939 | # include <__algorithm/ranges_contains.h> |
| 1940 | # include <__algorithm/ranges_copy.h> |
| 1941 | # include <__algorithm/ranges_copy_backward.h> |
| 1942 | # include <__algorithm/ranges_copy_if.h> |
| 1943 | # include <__algorithm/ranges_copy_n.h> |
| 1944 | # include <__algorithm/ranges_count.h> |
| 1945 | # include <__algorithm/ranges_count_if.h> |
| 1946 | # include <__algorithm/ranges_equal.h> |
| 1947 | # include <__algorithm/ranges_equal_range.h> |
| 1948 | # include <__algorithm/ranges_fill.h> |
| 1949 | # include <__algorithm/ranges_fill_n.h> |
| 1950 | # include <__algorithm/ranges_find.h> |
| 1951 | # include <__algorithm/ranges_find_end.h> |
| 1952 | # include <__algorithm/ranges_find_first_of.h> |
| 1953 | # include <__algorithm/ranges_find_if.h> |
| 1954 | # include <__algorithm/ranges_find_if_not.h> |
| 1955 | # include <__algorithm/ranges_for_each.h> |
| 1956 | # include <__algorithm/ranges_for_each_n.h> |
| 1957 | # include <__algorithm/ranges_generate.h> |
| 1958 | # include <__algorithm/ranges_generate_n.h> |
| 1959 | # include <__algorithm/ranges_includes.h> |
| 1960 | # include <__algorithm/ranges_inplace_merge.h> |
| 1961 | # include <__algorithm/ranges_is_heap.h> |
| 1962 | # include <__algorithm/ranges_is_heap_until.h> |
| 1963 | # include <__algorithm/ranges_is_partitioned.h> |
| 1964 | # include <__algorithm/ranges_is_permutation.h> |
| 1965 | # include <__algorithm/ranges_is_sorted.h> |
| 1966 | # include <__algorithm/ranges_is_sorted_until.h> |
| 1967 | # include <__algorithm/ranges_lexicographical_compare.h> |
| 1968 | # include <__algorithm/ranges_lower_bound.h> |
| 1969 | # include <__algorithm/ranges_make_heap.h> |
| 1970 | # include <__algorithm/ranges_max.h> |
| 1971 | # include <__algorithm/ranges_max_element.h> |
| 1972 | # include <__algorithm/ranges_merge.h> |
| 1973 | # include <__algorithm/ranges_min.h> |
| 1974 | # include <__algorithm/ranges_min_element.h> |
| 1975 | # include <__algorithm/ranges_minmax.h> |
| 1976 | # include <__algorithm/ranges_minmax_element.h> |
| 1977 | # include <__algorithm/ranges_mismatch.h> |
| 1978 | # include <__algorithm/ranges_move.h> |
| 1979 | # include <__algorithm/ranges_move_backward.h> |
| 1980 | # include <__algorithm/ranges_next_permutation.h> |
| 1981 | # include <__algorithm/ranges_none_of.h> |
| 1982 | # include <__algorithm/ranges_nth_element.h> |
| 1983 | # include <__algorithm/ranges_partial_sort.h> |
| 1984 | # include <__algorithm/ranges_partial_sort_copy.h> |
| 1985 | # include <__algorithm/ranges_partition.h> |
| 1986 | # include <__algorithm/ranges_partition_copy.h> |
| 1987 | # include <__algorithm/ranges_partition_point.h> |
| 1988 | # include <__algorithm/ranges_pop_heap.h> |
| 1989 | # include <__algorithm/ranges_prev_permutation.h> |
| 1990 | # include <__algorithm/ranges_push_heap.h> |
| 1991 | # include <__algorithm/ranges_remove.h> |
| 1992 | # include <__algorithm/ranges_remove_copy.h> |
| 1993 | # include <__algorithm/ranges_remove_copy_if.h> |
| 1994 | # include <__algorithm/ranges_remove_if.h> |
| 1995 | # include <__algorithm/ranges_replace.h> |
| 1996 | # include <__algorithm/ranges_replace_copy.h> |
| 1997 | # include <__algorithm/ranges_replace_copy_if.h> |
| 1998 | # include <__algorithm/ranges_replace_if.h> |
| 1999 | # include <__algorithm/ranges_reverse.h> |
| 2000 | # include <__algorithm/ranges_reverse_copy.h> |
| 2001 | # include <__algorithm/ranges_rotate.h> |
| 2002 | # include <__algorithm/ranges_rotate_copy.h> |
| 2003 | # include <__algorithm/ranges_sample.h> |
| 2004 | # include <__algorithm/ranges_search.h> |
| 2005 | # include <__algorithm/ranges_search_n.h> |
| 2006 | # include <__algorithm/ranges_set_difference.h> |
| 2007 | # include <__algorithm/ranges_set_intersection.h> |
| 2008 | # include <__algorithm/ranges_set_symmetric_difference.h> |
| 2009 | # include <__algorithm/ranges_set_union.h> |
| 2010 | # include <__algorithm/ranges_shuffle.h> |
| 2011 | # include <__algorithm/ranges_sort.h> |
| 2012 | # include <__algorithm/ranges_sort_heap.h> |
| 2013 | # include <__algorithm/ranges_stable_partition.h> |
| 2014 | # include <__algorithm/ranges_stable_sort.h> |
| 2015 | # include <__algorithm/ranges_swap_ranges.h> |
| 2016 | # include <__algorithm/ranges_transform.h> |
| 2017 | # include <__algorithm/ranges_unique.h> |
| 2018 | # include <__algorithm/ranges_unique_copy.h> |
| 2019 | # include <__algorithm/ranges_upper_bound.h> |
| 2020 | # include <__algorithm/shift_left.h> |
| 2021 | # include <__algorithm/shift_right.h> |
| 2022 | # endif |
Nikolas Klauser | d5c654b | 2024-04-14 13:52:56 | [diff] [blame] | 2023 | |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 2024 | # if _LIBCPP_STD_VER >= 23 |
| 2025 | # include <__algorithm/ranges_contains_subrange.h> |
| 2026 | # include <__algorithm/ranges_ends_with.h> |
| 2027 | # include <__algorithm/ranges_find_last.h> |
| 2028 | # include <__algorithm/ranges_fold.h> |
| 2029 | # include <__algorithm/ranges_starts_with.h> |
| 2030 | # endif // _LIBCPP_STD_VER >= 23 |
Nikolas Klauser | d5c654b | 2024-04-14 13:52:56 | [diff] [blame] | 2031 | |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 2032 | # include <version> |
Nikolas Klauser | d5c654b | 2024-04-14 13:52:56 | [diff] [blame] | 2033 | |
Nikolas Klauser | db1978b | 2022-06-16 20:43:46 | [diff] [blame] | 2034 | // standard-mandated includes |
Nikolas Klauser | 473a160 | 2022-09-22 16:05:08 | [diff] [blame] | 2035 | |
| 2036 | // [algorithm.syn] |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 2037 | # include <initializer_list> |
Nikolas Klauser | db1978b | 2022-06-16 20:43:46 | [diff] [blame] | 2038 | |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 2039 | # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 2040 | # pragma GCC system_header |
| 2041 | # endif |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 2042 | |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 2043 | # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 14 |
| 2044 | # include <execution> |
| 2045 | # endif |
Nikolas Klauser | d5c654b | 2024-04-14 13:52:56 | [diff] [blame] | 2046 | |
Nikolas Klauser | c166a9c | 2024-12-10 15:02:12 | [diff] [blame^] | 2047 | # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 |
| 2048 | # include <atomic> |
| 2049 | # include <bit> |
| 2050 | # include <concepts> |
| 2051 | # include <cstdlib> |
| 2052 | # include <cstring> |
| 2053 | # include <iterator> |
| 2054 | # include <memory> |
| 2055 | # include <stdexcept> |
| 2056 | # include <type_traits> |
| 2057 | # include <utility> |
| 2058 | # endif |
| 2059 | #endif // 0 |
Mark de Wever | e31c2a1 | 2022-09-02 15:53:28 | [diff] [blame] | 2060 | |
Louis Dionne | 4cd6ca1 | 2021-04-20 16:03:32 | [diff] [blame] | 2061 | #endif // _LIBCPP_ALGORITHM |