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 { |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 22 | template <class I, class F> |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 23 | struct in_fun_result; // since C++20 |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 24 | |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 25 | template <class I1, class I2> |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 26 | struct in_in_result; // since C++20 |
Nikolas Klauser | f3514af | 2022-01-25 10:21:47 | [diff] [blame] | 27 | |
| 28 | template <class I1, class I2, class O> |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 29 | struct in_in_out_result; // since C++20 |
Nikolas Klauser | 610979b | 2022-02-03 01:17:03 | [diff] [blame] | 30 | |
| 31 | template <class I, class O1, class O2> |
| 32 | struct in_out_out_result; // since C++20 |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 33 | |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 34 | template <class I1, class I2> |
| 35 | struct min_max_result; // since C++20 |
| 36 | |
Nikolas Klauser | 68f4131 | 2022-02-21 22:07:02 | [diff] [blame] | 37 | template <class I> |
| 38 | struct in_found_result; // since C++20 |
| 39 | |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 40 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 41 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // since C++20 |
| 42 | constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {}); |
| 43 | |
| 44 | template<forward_range R, class Proj = identity, |
| 45 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> // since C++20 |
| 46 | constexpr borrowed_iterator_t<R> min_element(R&& r, Comp comp = {}, Proj proj = {}); |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 47 | |
Nikolas Klauser | 40f7fca3 | 2022-05-22 11:43:37 | [diff] [blame] | 48 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 49 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 50 | constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 51 | |
| 52 | template<forward_range R, class Proj = identity, |
| 53 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 54 | constexpr borrowed_iterator_t<R> ranges::max_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 55 | |
| 56 | |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 57 | template <input_iterator I1, sentinel_for<_I1> S1, input_iterator I2, sentinel_for<_I2> S2, |
| 58 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 59 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 60 | constexpr mismatch_result<_I1, _I2> |
| 61 | mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20 |
| 62 | |
| 63 | template <input_range R1, input_range R2, |
| 64 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 65 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 66 | constexpr mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
| 67 | 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] | 68 | |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 69 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 70 | constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20 |
| 71 | |
| 72 | template<input_range R, class T, class Proj = identity> |
| 73 | requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 74 | constexpr borrowed_iterator_t<R> |
| 75 | find(R&& r, const T& value, Proj proj = {}); // since C++20 |
| 76 | |
| 77 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 78 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 79 | constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 80 | |
| 81 | template<input_range R, class Proj = identity, |
| 82 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 83 | constexpr borrowed_iterator_t<R> |
| 84 | find_if(R&& r, Pred pred, Proj proj = {}); // since C++20 |
| 85 | |
| 86 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 87 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 88 | constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 89 | |
| 90 | template<input_range R, class Proj = identity, |
| 91 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 92 | constexpr borrowed_iterator_t<R> |
| 93 | find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 94 | |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 95 | template<class T, class Proj = identity, |
| 96 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 97 | 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] | 98 | |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 99 | template<copyable T, class Proj = identity, |
| 100 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 101 | 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] | 102 | |
| 103 | template<input_range R, class Proj = identity, |
| 104 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 105 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 106 | constexpr range_value_t<R> |
| 107 | min(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 108 | |
| 109 | template<class T, class Proj = identity, |
| 110 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 111 | constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 |
| 112 | |
| 113 | template<copyable T, class Proj = identity, |
| 114 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 115 | constexpr T max(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 116 | |
| 117 | template<input_range R, class Proj = identity, |
| 118 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 119 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 120 | constexpr range_value_t<R> |
| 121 | max(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 122 | |
| 123 | template<class I, class O> |
| 124 | using unary_transform_result = in_out_result<I, O>; // since C++20 |
| 125 | |
| 126 | template<class I1, class I2, class O> |
| 127 | using binary_transform_result = in_in_out_result<I1, I2, O>; // since C++20 |
| 128 | |
| 129 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, |
| 130 | copy_constructible F, class Proj = identity> |
| 131 | requires indirectly_writable<O, indirect_result_t<F&, projected<I, Proj>>> |
| 132 | constexpr ranges::unary_transform_result<I, O> |
| 133 | transform(I first1, S last1, O result, F op, Proj proj = {}); // since C++20 |
| 134 | |
| 135 | template<input_range R, weakly_incrementable O, copy_constructible F, |
| 136 | class Proj = identity> |
| 137 | requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R>, Proj>>> |
| 138 | constexpr ranges::unary_transform_result<borrowed_iterator_t<R>, O> |
| 139 | transform(R&& r, O result, F op, Proj proj = {}); // since C++20 |
| 140 | |
| 141 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 142 | weakly_incrementable O, copy_constructible F, class Proj1 = identity, |
| 143 | class Proj2 = identity> |
| 144 | requires indirectly_writable<O, indirect_result_t<F&, projected<I1, Proj1>, |
| 145 | projected<I2, Proj2>>> |
| 146 | constexpr ranges::binary_transform_result<I1, I2, O> |
| 147 | transform(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
| 148 | F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 149 | |
| 150 | template<input_range R1, input_range R2, weakly_incrementable O, |
| 151 | copy_constructible F, class Proj1 = identity, class Proj2 = identity> |
| 152 | requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R1>, Proj1>, |
| 153 | projected<iterator_t<R2>, Proj2>>> |
| 154 | constexpr ranges::binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> |
| 155 | transform(R1&& r1, R2&& r2, O result, |
| 156 | F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 157 | |
| 158 | template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity> |
| 159 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 160 | constexpr iter_difference_t<I> |
| 161 | count(I first, S last, const T& value, Proj proj = {}); // since C++20 |
| 162 | |
| 163 | template<input_range R, class T, class Proj = identity> |
| 164 | requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 165 | constexpr range_difference_t<R> |
| 166 | count(R&& r, const T& value, Proj proj = {}); // since C++20 |
| 167 | |
| 168 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 169 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 170 | constexpr iter_difference_t<I> |
| 171 | count_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 172 | |
| 173 | template<input_range R, class Proj = identity, |
| 174 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 175 | constexpr range_difference_t<R> |
| 176 | count_if(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 177 | |
| 178 | template<class T, class Proj = identity, |
| 179 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 180 | constexpr ranges::minmax_result<const T&> |
| 181 | minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 |
| 182 | |
| 183 | template<copyable T, class Proj = identity, |
| 184 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 185 | constexpr ranges::minmax_result<T> |
| 186 | minmax(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 187 | |
| 188 | template<input_range R, class Proj = identity, |
| 189 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 190 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 191 | constexpr ranges::minmax_result<range_value_t<R>> |
| 192 | minmax(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 193 | |
| 194 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 195 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 196 | constexpr ranges::minmax_element_result<I> |
| 197 | minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 198 | |
| 199 | template<forward_range R, class Proj = identity, |
| 200 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 201 | constexpr ranges::minmax_element_result<borrowed_iterator_t<R>> |
| 202 | minmax_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 203 | |
| 204 | template<class I, class O> |
| 205 | using copy_result = in_out_result<I, O>; // since C++20 |
| 206 | |
| 207 | template<class I, class O> |
| 208 | using copy_n_result = in_out_result<I, O>; // since C++20 |
| 209 | |
| 210 | template<class I, class O> |
| 211 | using copy_if_result = in_out_result<I, O>; // since C++20 |
| 212 | |
| 213 | template<class I1, class I2> |
| 214 | using copy_backward_result = in_out_result<I1, I2>; // since C++20 |
| 215 | |
| 216 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O> |
| 217 | requires indirectly_copyable<I, O> |
| 218 | constexpr ranges::copy_result<I, O> ranges::copy(I first, S last, O result); // since C++20 |
| 219 | |
| 220 | template<input_range R, weakly_incrementable O> |
| 221 | requires indirectly_copyable<iterator_t<R>, O> |
| 222 | constexpr ranges::copy_result<borrowed_iterator_t<R>, O> ranges::copy(R&& r, O result); // since C++20 |
| 223 | |
| 224 | template<input_iterator I, weakly_incrementable O> |
| 225 | requires indirectly_copyable<I, O> |
| 226 | constexpr ranges::copy_n_result<I, O> |
| 227 | ranges::copy_n(I first, iter_difference_t<I> n, O result); // since C++20 |
| 228 | |
| 229 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Proj = identity, |
| 230 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 231 | requires indirectly_copyable<I, O> |
| 232 | constexpr ranges::copy_if_result<I, O> |
| 233 | ranges::copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // since C++20 |
| 234 | |
| 235 | template<input_range R, weakly_incrementable O, class Proj = identity, |
| 236 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 237 | requires indirectly_copyable<iterator_t<R>, O> |
| 238 | constexpr ranges::copy_if_result<borrowed_iterator_t<R>, O> |
| 239 | ranges::copy_if(R&& r, O result, Pred pred, Proj proj = {}); // since C++20 |
| 240 | |
| 241 | template<bidirectional_iterator I1, sentinel_for<I1> S1, bidirectional_iterator I2> |
| 242 | requires indirectly_copyable<I1, I2> |
| 243 | constexpr ranges::copy_backward_result<I1, I2> |
| 244 | ranges::copy_backward(I1 first, S1 last, I2 result); // since C++20 |
| 245 | |
| 246 | template<bidirectional_range R, bidirectional_iterator I> |
| 247 | requires indirectly_copyable<iterator_t<R>, I> |
| 248 | constexpr ranges::copy_backward_result<borrowed_iterator_t<R>, I> |
| 249 | ranges::copy_backward(R&& r, I result); // since C++20 |
Nikolas Klauser | 80045e9 | 2022-05-04 18:27:07 | [diff] [blame] | 250 | |
| 251 | template<class I, class F> |
| 252 | using for_each_result = in_fun_result<I, F>; // since C++20 |
| 253 | |
| 254 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 255 | indirectly_unary_invocable<projected<I, Proj>> Fun> |
| 256 | constexpr ranges::for_each_result<I, Fun> |
| 257 | ranges::for_each(I first, S last, Fun f, Proj proj = {}); // since C++20 |
| 258 | |
| 259 | template<input_range R, class Proj = identity, |
| 260 | indirectly_unary_invocable<projected<iterator_t<R>, Proj>> Fun> |
| 261 | constexpr ranges::for_each_result<borrowed_iterator_t<R>, Fun> |
| 262 | ranges::for_each(R&& r, Fun f, Proj proj = {}); // since C++20 |
| 263 | |
| 264 | template<input_iterator I, class Proj = identity, |
| 265 | indirectly_unary_invocable<projected<I, Proj>> Fun> |
| 266 | constexpr ranges::for_each_n_result<I, Fun> |
| 267 | 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] | 268 | |
| 269 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 270 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 271 | constexpr bool ranges::is_partitioned(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 272 | |
| 273 | template<input_range R, class Proj = identity, |
| 274 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 275 | constexpr bool ranges::is_partitioned(R&& r, Pred pred, Proj proj = {}); // since C++20 |
| 276 | |
Nikolas Klauser | 1d1a191 | 2022-05-24 08:32:50 | [diff] [blame] | 277 | |
| 278 | template<bidirectional_iterator I, sentinel_for<I> S> |
| 279 | requires permutable<I> |
| 280 | constexpr I ranges::reverse(I first, S last); // since C++20 |
| 281 | |
| 282 | template<bidirectional_range R> |
| 283 | requires permutable<iterator_t<R>> |
| 284 | constexpr borrowed_iterator_t<R> ranges::reverse(R&& r); // since C++20 |
| 285 | |
Nikolas Klauser | 7af89a3 | 2022-05-21 16:26:29 | [diff] [blame] | 286 | template<class T, output_iterator<const T&> O, sentinel_for<O> S> |
| 287 | constexpr O ranges::fill(O first, S last, const T& value); // since C++20 |
| 288 | |
| 289 | template<class T, output_range<const T&> R> |
| 290 | constexpr borrowed_iterator_t<R> ranges::fill(R&& r, const T& value); // since C++20 |
| 291 | |
| 292 | template<class T, output_iterator<const T&> O> |
| 293 | 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] | 294 | |
| 295 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 296 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 297 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 298 | constexpr bool ranges::equal(I1 first1, S1 last1, I2 first2, S2 last2, |
| 299 | Pred pred = {}, |
| 300 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 301 | |
| 302 | template<input_range R1, input_range R2, class Pred = ranges::equal_to, |
| 303 | class Proj1 = identity, class Proj2 = identity> |
| 304 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 305 | constexpr bool ranges::equal(R1&& r1, R2&& r2, Pred pred = {}, |
| 306 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 307 | |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 308 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 309 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 310 | constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 311 | |
| 312 | template<input_range R, class Proj = identity, |
| 313 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 314 | constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {}); // since C++20 |
| 315 | |
| 316 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 317 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 318 | constexpr bool ranges::any_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 319 | |
| 320 | template<input_range R, class Proj = identity, |
| 321 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 322 | constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); // since C++20 |
| 323 | |
| 324 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 325 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 326 | constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 327 | |
| 328 | template<input_range R, class Proj = identity, |
| 329 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 330 | constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20 |
| 331 | |
Nikolas Klauser | 11e3ad2 | 2022-05-26 14:08:55 | [diff] [blame] | 332 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 333 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 334 | constexpr bool ranges::is_sorted(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 335 | |
| 336 | template<forward_range R, class Proj = identity, |
| 337 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 338 | constexpr bool ranges::is_sorted(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 339 | |
| 340 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 341 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 342 | constexpr I ranges::is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 343 | |
| 344 | template<forward_range R, class Proj = identity, |
| 345 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 346 | constexpr borrowed_iterator_t<R> |
| 347 | ranges::is_sorted_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 348 | |
| 349 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 350 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> |
| 351 | constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
| 352 | |
| 353 | template<forward_range R, class T, class Proj = identity, |
| 354 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 355 | ranges::less> |
| 356 | constexpr borrowed_iterator_t<R> |
| 357 | upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
| 358 | |
| 359 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 360 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> |
| 361 | constexpr I lower_bound(I first, S last, const T& value, Comp comp = {}, |
| 362 | Proj proj = {}); // since C++20 |
| 363 | template<forward_range R, class T, class Proj = identity, |
| 364 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 365 | ranges::less> |
| 366 | constexpr borrowed_iterator_t<R> |
| 367 | lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
| 368 | |
| 369 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 370 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> |
| 371 | constexpr bool binary_search(I first, S last, const T& value, Comp comp = {}, |
| 372 | Proj proj = {}); // since C++20 |
Nikolas Klauser | b79b2b6 | 2022-06-06 11:57:34 | [diff] [blame] | 373 | |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 374 | template<forward_range R, class T, class Proj = identity, |
| 375 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 376 | ranges::less> |
| 377 | constexpr bool binary_search(R&& r, const T& value, Comp comp = {}, |
| 378 | Proj proj = {}); // since C++20 |
Nikolas Klauser | b79b2b6 | 2022-06-06 11:57:34 | [diff] [blame] | 379 | template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2, |
| 380 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 381 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 382 | constexpr I1 ranges::find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, |
| 383 | Pred pred = {}, |
| 384 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 385 | |
| 386 | template<input_range R1, forward_range R2, |
| 387 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 388 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 389 | constexpr borrowed_iterator_t<R1> |
| 390 | ranges::find_first_of(R1&& r1, R2&& r2, |
| 391 | Pred pred = {}, |
| 392 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 393 | |
Nikolas Klauser | 916e905 | 2022-06-08 10:14:12 | [diff] [blame] | 394 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 395 | indirect_binary_predicate<projected<I, Proj>, |
| 396 | projected<I, Proj>> Pred = ranges::equal_to> |
| 397 | constexpr I ranges::adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); // since C+20 |
| 398 | |
| 399 | template<forward_range R, class Proj = identity, |
| 400 | indirect_binary_predicate<projected<iterator_t<R>, Proj>, |
| 401 | projected<iterator_t<R>, Proj>> Pred = ranges::equal_to> |
| 402 | constexpr borrowed_iterator_t<R> ranges::adjacent_find(R&& r, Pred pred = {}, Proj proj = {}); // since C++20 |
| 403 | |
Nikolas Klauser | ff6d5de | 2022-06-07 07:42:10 | [diff] [blame] | 404 | template<input_iterator I, sentinel_for<I> S, class T1, class T2, class Proj = identity> |
| 405 | requires indirectly_writable<I, const T2&> && |
| 406 | indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*> |
| 407 | constexpr I |
| 408 | ranges::replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {}); // since C++20 |
| 409 | |
| 410 | template<input_range R, class T1, class T2, class Proj = identity> |
| 411 | requires indirectly_writable<iterator_t<R>, const T2&> && |
| 412 | indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T1*> |
| 413 | constexpr borrowed_iterator_t<R> |
| 414 | ranges::replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {}); // since C++20 |
| 415 | |
| 416 | template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 417 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 418 | requires indirectly_writable<I, const T&> |
| 419 | constexpr I ranges::replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {}); // since C++20 |
| 420 | |
| 421 | template<input_range R, class T, class Proj = identity, |
| 422 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 423 | requires indirectly_writable<iterator_t<R>, const T&> |
| 424 | constexpr borrowed_iterator_t<R> |
| 425 | ranges::replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {}); // since C++20 |
| 426 | |
Nikolas Klauser | afd5a4f | 2022-06-15 14:24:43 | [diff] [blame^] | 427 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 428 | class Proj1 = identity, class Proj2 = identity, |
| 429 | indirect_strict_weak_order<projected<I1, Proj1>, |
| 430 | projected<I2, Proj2>> Comp = ranges::less> |
| 431 | constexpr bool |
| 432 | ranges::lexicographical_compare(I1 first1, S1 last1, I2 first2, S2 last2, |
| 433 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 434 | |
| 435 | template<input_range R1, input_range R2, class Proj1 = identity, |
| 436 | class Proj2 = identity, |
| 437 | indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>, |
| 438 | projected<iterator_t<R2>, Proj2>> Comp = ranges::less> |
| 439 | constexpr bool |
| 440 | ranges::lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {}, |
| 441 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 442 | |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 443 | } |
| 444 | |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 445 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 446 | all_of(InputIterator first, InputIterator last, Predicate pred); |
| 447 | |
| 448 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 449 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 450 | any_of(InputIterator first, InputIterator last, Predicate pred); |
| 451 | |
| 452 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 453 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 454 | none_of(InputIterator first, InputIterator last, Predicate pred); |
| 455 | |
| 456 | template <class InputIterator, class Function> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 457 | constexpr Function // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 458 | for_each(InputIterator first, InputIterator last, Function f); |
| 459 | |
Marshall Clow | d5c65ff | 2017-05-25 02:29:54 | [diff] [blame] | 460 | template<class InputIterator, class Size, class Function> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 461 | constexpr InputIterator // constexpr in C++20 |
| 462 | for_each_n(InputIterator first, Size n, Function f); // C++17 |
Marshall Clow | d5c65ff | 2017-05-25 02:29:54 | [diff] [blame] | 463 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 464 | template <class InputIterator, class T> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 465 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 466 | find(InputIterator first, InputIterator last, const T& value); |
| 467 | |
| 468 | template <class InputIterator, class Predicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 469 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 470 | find_if(InputIterator first, InputIterator last, Predicate pred); |
| 471 | |
| 472 | template<class InputIterator, class Predicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 473 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 474 | find_if_not(InputIterator first, InputIterator last, Predicate pred); |
| 475 | |
| 476 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 477 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 478 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 479 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 480 | |
| 481 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 482 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 483 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 484 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 485 | |
| 486 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 487 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 488 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 489 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 490 | |
| 491 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 492 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 493 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 494 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 495 | |
| 496 | template <class ForwardIterator> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 497 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 498 | adjacent_find(ForwardIterator first, ForwardIterator last); |
| 499 | |
| 500 | template <class ForwardIterator, class BinaryPredicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 501 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 502 | adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 503 | |
| 504 | template <class InputIterator, class T> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 505 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 506 | count(InputIterator first, InputIterator last, const T& value); |
| 507 | |
| 508 | template <class InputIterator, class Predicate> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 509 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 510 | count_if(InputIterator first, InputIterator last, Predicate pred); |
| 511 | |
| 512 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 513 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 514 | mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 515 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 516 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 517 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Aditya Kumar | 331fb80 | 2016-08-25 11:52:38 | [diff] [blame] | 518 | mismatch(InputIterator1 first1, InputIterator1 last1, |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 519 | InputIterator2 first2, InputIterator2 last2); // **C++14** |
| 520 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 521 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 522 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 523 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 524 | InputIterator2 first2, BinaryPredicate pred); |
| 525 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 526 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 527 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 528 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 529 | InputIterator2 first2, InputIterator2 last2, |
| 530 | BinaryPredicate pred); // **C++14** |
| 531 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 532 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 533 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 534 | equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 535 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 536 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 537 | constexpr bool // constexpr in C++20 |
Aditya Kumar | 331fb80 | 2016-08-25 11:52:38 | [diff] [blame] | 538 | equal(InputIterator1 first1, InputIterator1 last1, |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 539 | InputIterator2 first2, InputIterator2 last2); // **C++14** |
| 540 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 541 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 542 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 543 | equal(InputIterator1 first1, InputIterator1 last1, |
| 544 | InputIterator2 first2, BinaryPredicate pred); |
| 545 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 546 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 547 | constexpr bool // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 548 | equal(InputIterator1 first1, InputIterator1 last1, |
| 549 | InputIterator2 first2, InputIterator2 last2, |
| 550 | BinaryPredicate pred); // **C++14** |
| 551 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 552 | template<class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 553 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 554 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 555 | ForwardIterator2 first2); |
| 556 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 557 | template<class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 558 | constexpr bool // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 559 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 560 | ForwardIterator2 first2, ForwardIterator2 last2); // **C++14** |
| 561 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 562 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 563 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 564 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 565 | ForwardIterator2 first2, BinaryPredicate pred); |
| 566 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 567 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 568 | constexpr bool // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 569 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 570 | ForwardIterator2 first2, ForwardIterator2 last2, |
| 571 | BinaryPredicate pred); // **C++14** |
| 572 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 573 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 574 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 575 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 576 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 577 | |
| 578 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 579 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 580 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 581 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 582 | |
| 583 | template <class ForwardIterator, class Size, class T> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 584 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 585 | search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); |
| 586 | |
| 587 | template <class ForwardIterator, class Size, class T, class BinaryPredicate> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 588 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 589 | search_n(ForwardIterator first, ForwardIterator last, |
| 590 | Size count, const T& value, BinaryPredicate pred); |
| 591 | |
| 592 | template <class InputIterator, class OutputIterator> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 593 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 594 | copy(InputIterator first, InputIterator last, OutputIterator result); |
| 595 | |
| 596 | template<class InputIterator, class OutputIterator, class Predicate> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 597 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 598 | copy_if(InputIterator first, InputIterator last, |
| 599 | OutputIterator result, Predicate pred); |
| 600 | |
| 601 | template<class InputIterator, class Size, class OutputIterator> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 602 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 603 | copy_n(InputIterator first, Size n, OutputIterator result); |
| 604 | |
| 605 | template <class BidirectionalIterator1, class BidirectionalIterator2> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 606 | constexpr BidirectionalIterator2 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 607 | copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, |
| 608 | BidirectionalIterator2 result); |
| 609 | |
| 610 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 611 | constexpr ForwardIterator2 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 612 | swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); |
| 613 | |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 614 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2> |
| 615 | requires indirectly_swappable<I1, I2> |
| 616 | constexpr ranges::swap_ranges_result<I1, I2> |
| 617 | ranges::swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2); |
| 618 | |
| 619 | template<input_range R1, input_range R2> |
| 620 | requires indirectly_swappable<iterator_t<R1>, iterator_t<R2>> |
| 621 | constexpr ranges::swap_ranges_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
| 622 | ranges::swap_ranges(R1&& r1, R2&& r2); |
| 623 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 624 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 625 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 626 | iter_swap(ForwardIterator1 a, ForwardIterator2 b); |
| 627 | |
| 628 | template <class InputIterator, class OutputIterator, class UnaryOperation> |
Marshall Clow | 99894b6 | 2018-01-19 17:45:39 | [diff] [blame] | 629 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 630 | transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op); |
| 631 | |
| 632 | template <class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation> |
Marshall Clow | 99894b6 | 2018-01-19 17:45:39 | [diff] [blame] | 633 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 634 | transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, |
| 635 | OutputIterator result, BinaryOperation binary_op); |
| 636 | |
| 637 | template <class ForwardIterator, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 638 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 639 | replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value); |
| 640 | |
| 641 | template <class ForwardIterator, class Predicate, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 642 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 643 | replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value); |
| 644 | |
| 645 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 646 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 647 | replace_copy(InputIterator first, InputIterator last, OutputIterator result, |
| 648 | const T& old_value, const T& new_value); |
| 649 | |
| 650 | template <class InputIterator, class OutputIterator, class Predicate, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 651 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 652 | replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value); |
| 653 | |
| 654 | template <class ForwardIterator, class T> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 655 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 656 | fill(ForwardIterator first, ForwardIterator last, const T& value); |
| 657 | |
| 658 | template <class OutputIterator, class Size, class T> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 659 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 660 | fill_n(OutputIterator first, Size n, const T& value); |
| 661 | |
| 662 | template <class ForwardIterator, class Generator> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 663 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 664 | generate(ForwardIterator first, ForwardIterator last, Generator gen); |
| 665 | |
| 666 | template <class OutputIterator, class Size, class Generator> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 667 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 668 | generate_n(OutputIterator first, Size n, Generator gen); |
| 669 | |
| 670 | template <class ForwardIterator, class T> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 671 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 672 | remove(ForwardIterator first, ForwardIterator last, const T& value); |
| 673 | |
| 674 | template <class ForwardIterator, class Predicate> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 675 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 676 | remove_if(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 677 | |
| 678 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 679 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 680 | remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); |
| 681 | |
| 682 | template <class InputIterator, class OutputIterator, class Predicate> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 683 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 684 | remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); |
| 685 | |
| 686 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 687 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 688 | unique(ForwardIterator first, ForwardIterator last); |
| 689 | |
| 690 | template <class ForwardIterator, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 691 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 692 | unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 693 | |
| 694 | template <class InputIterator, class OutputIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 695 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 696 | unique_copy(InputIterator first, InputIterator last, OutputIterator result); |
| 697 | |
| 698 | template <class InputIterator, class OutputIterator, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 699 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 700 | unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred); |
| 701 | |
| 702 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 703 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 704 | reverse(BidirectionalIterator first, BidirectionalIterator last); |
| 705 | |
| 706 | template <class BidirectionalIterator, class OutputIterator> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 707 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 708 | reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); |
| 709 | |
| 710 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 711 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 712 | rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last); |
| 713 | |
| 714 | template <class ForwardIterator, class OutputIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 715 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 716 | rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result); |
| 717 | |
| 718 | template <class RandomAccessIterator> |
| 719 | void |
Marshall Clow | 0f37a41 | 2017-03-23 13:43:37 | [diff] [blame] | 720 | 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] | 721 | |
| 722 | template <class RandomAccessIterator, class RandomNumberGenerator> |
| 723 | void |
Marshall Clow | 06965c1 | 2014-03-03 06:14:19 | [diff] [blame] | 724 | random_shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Marshall Clow | 0f37a41 | 2017-03-23 13:43:37 | [diff] [blame] | 725 | RandomNumberGenerator& rand); // deprecated in C++14, removed in C++17 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 726 | |
Eric Fiselier | e715470 | 2016-08-28 22:14:37 | [diff] [blame] | 727 | template<class PopulationIterator, class SampleIterator, |
| 728 | class Distance, class UniformRandomBitGenerator> |
| 729 | SampleIterator sample(PopulationIterator first, PopulationIterator last, |
| 730 | SampleIterator out, Distance n, |
| 731 | UniformRandomBitGenerator&& g); // C++17 |
| 732 | |
Howard Hinnant | f9d540b | 2010-05-26 17:49:34 | [diff] [blame] | 733 | template<class RandomAccessIterator, class UniformRandomNumberGenerator> |
| 734 | void shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Howard Hinnant | fb34010 | 2010-11-18 01:47:02 | [diff] [blame] | 735 | UniformRandomNumberGenerator&& g); |
Howard Hinnant | f9d540b | 2010-05-26 17:49:34 | [diff] [blame] | 736 | |
Arthur O'Dwyer | 3fbd3ea | 2020-12-26 06:39:03 | [diff] [blame] | 737 | template<class ForwardIterator> |
| 738 | constexpr ForwardIterator |
| 739 | shift_left(ForwardIterator first, ForwardIterator last, |
| 740 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 741 | |
| 742 | template<class ForwardIterator> |
| 743 | constexpr ForwardIterator |
| 744 | shift_right(ForwardIterator first, ForwardIterator last, |
| 745 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 746 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 747 | template <class InputIterator, class Predicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 748 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 749 | is_partitioned(InputIterator first, InputIterator last, Predicate pred); |
| 750 | |
| 751 | template <class ForwardIterator, class Predicate> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 752 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 753 | partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 754 | |
| 755 | template <class InputIterator, class OutputIterator1, |
| 756 | class OutputIterator2, class Predicate> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 757 | constexpr pair<OutputIterator1, OutputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 758 | partition_copy(InputIterator first, InputIterator last, |
| 759 | OutputIterator1 out_true, OutputIterator2 out_false, |
| 760 | Predicate pred); |
| 761 | |
| 762 | template <class ForwardIterator, class Predicate> |
| 763 | ForwardIterator |
| 764 | stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 765 | |
| 766 | template<class ForwardIterator, class Predicate> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 767 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 768 | partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 769 | |
| 770 | template <class ForwardIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 771 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 772 | is_sorted(ForwardIterator first, ForwardIterator last); |
| 773 | |
| 774 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 775 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 776 | is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); |
| 777 | |
| 778 | template<class ForwardIterator> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 779 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 780 | is_sorted_until(ForwardIterator first, ForwardIterator last); |
| 781 | |
| 782 | template <class ForwardIterator, class Compare> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 783 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 784 | is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); |
| 785 | |
| 786 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 493f140 | 2020-12-20 20:21:42 | [diff] [blame] | 787 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 788 | sort(RandomAccessIterator first, RandomAccessIterator last); |
| 789 | |
| 790 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 493f140 | 2020-12-20 20:21:42 | [diff] [blame] | 791 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 792 | sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 793 | |
| 794 | template <class RandomAccessIterator> |
| 795 | void |
| 796 | stable_sort(RandomAccessIterator first, RandomAccessIterator last); |
| 797 | |
| 798 | template <class RandomAccessIterator, class Compare> |
| 799 | void |
| 800 | stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 801 | |
| 802 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 803 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 804 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last); |
| 805 | |
| 806 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 807 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 808 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); |
| 809 | |
| 810 | template <class InputIterator, class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 811 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 812 | partial_sort_copy(InputIterator first, InputIterator last, |
| 813 | RandomAccessIterator result_first, RandomAccessIterator result_last); |
| 814 | |
| 815 | template <class InputIterator, class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 816 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 817 | partial_sort_copy(InputIterator first, InputIterator last, |
| 818 | RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp); |
| 819 | |
| 820 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5d95656 | 2021-02-04 23:12:52 | [diff] [blame] | 821 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 822 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last); |
| 823 | |
| 824 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5d95656 | 2021-02-04 23:12:52 | [diff] [blame] | 825 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 826 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); |
| 827 | |
| 828 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 829 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 830 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 831 | |
| 832 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 833 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 834 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 835 | |
| 836 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 837 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 838 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 839 | |
| 840 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 841 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 842 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 843 | |
| 844 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 845 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 846 | equal_range(ForwardIterator first, ForwardIterator last, const T& value); |
| 847 | |
| 848 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 849 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 850 | equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 851 | |
| 852 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 853 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 854 | binary_search(ForwardIterator first, ForwardIterator last, const T& value); |
| 855 | |
| 856 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 857 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 858 | binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 859 | |
| 860 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 861 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 862 | merge(InputIterator1 first1, InputIterator1 last1, |
| 863 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 864 | |
| 865 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 866 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 867 | merge(InputIterator1 first1, InputIterator1 last1, |
| 868 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 869 | |
| 870 | template <class BidirectionalIterator> |
| 871 | void |
| 872 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last); |
| 873 | |
| 874 | template <class BidirectionalIterator, class Compare> |
| 875 | void |
| 876 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp); |
| 877 | |
| 878 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 879 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 880 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 881 | |
| 882 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 883 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 884 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 885 | |
| 886 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 887 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 888 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 889 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 890 | |
| 891 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 892 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 893 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 894 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 895 | |
| 896 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 897 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 898 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 899 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 900 | |
| 901 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 902 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 903 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 904 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 905 | |
| 906 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 907 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 908 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 909 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 910 | |
| 911 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 912 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 913 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 914 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 915 | |
| 916 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 917 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 918 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 919 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 920 | |
| 921 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 922 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 923 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 924 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 925 | |
| 926 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 927 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 928 | push_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 929 | |
| 930 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 931 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 932 | push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 933 | |
| 934 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 935 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 936 | pop_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 937 | |
| 938 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 939 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 940 | pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 941 | |
| 942 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 943 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 944 | make_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 945 | |
| 946 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 947 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 948 | make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 949 | |
| 950 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 951 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 952 | sort_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 953 | |
| 954 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 955 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 956 | sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 957 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 958 | template <class RandomAccessIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 959 | constexpr bool // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 960 | is_heap(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 961 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 962 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 963 | constexpr bool // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 964 | is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 965 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 966 | template <class RandomAccessIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 967 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 968 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 969 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 970 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 971 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 972 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 973 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 974 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 975 | constexpr ForwardIterator // constexpr in C++14 |
| 976 | min_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 977 | |
| 978 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 979 | constexpr ForwardIterator // constexpr in C++14 |
| 980 | min_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 981 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 982 | template <class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 983 | constexpr const T& // constexpr in C++14 |
| 984 | min(const T& a, const T& b); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 985 | |
| 986 | template <class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 987 | constexpr const T& // constexpr in C++14 |
| 988 | min(const T& a, const T& b, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 989 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 990 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 991 | constexpr T // constexpr in C++14 |
| 992 | min(initializer_list<T> t); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 993 | |
| 994 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 995 | constexpr T // constexpr in C++14 |
| 996 | min(initializer_list<T> t, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 997 | |
Marshall Clow | 146c14a | 2016-03-07 22:43:49 | [diff] [blame] | 998 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 999 | 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] | 1000 | |
| 1001 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1002 | 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] | 1003 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1004 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1005 | constexpr ForwardIterator // constexpr in C++14 |
| 1006 | max_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1007 | |
| 1008 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1009 | constexpr ForwardIterator // constexpr in C++14 |
| 1010 | max_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1011 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1012 | template <class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1013 | constexpr const T& // constexpr in C++14 |
| 1014 | max(const T& a, const T& b); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1015 | |
| 1016 | template <class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1017 | constexpr const T& // constexpr in C++14 |
| 1018 | max(const T& a, const T& b, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1019 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1020 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1021 | constexpr T // constexpr in C++14 |
| 1022 | max(initializer_list<T> t); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1023 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1024 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1025 | constexpr T // constexpr in C++14 |
| 1026 | max(initializer_list<T> t, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1027 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1028 | template<class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1029 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 1030 | minmax_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1031 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1032 | template<class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1033 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 1034 | minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1035 | |
| 1036 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1037 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 1038 | minmax(const T& a, const T& b); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1039 | |
| 1040 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1041 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 1042 | minmax(const T& a, const T& b, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1043 | |
| 1044 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1045 | constexpr pair<T, T> // constexpr in C++14 |
| 1046 | minmax(initializer_list<T> t); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1047 | |
| 1048 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1049 | constexpr pair<T, T> // constexpr in C++14 |
| 1050 | minmax(initializer_list<T> t, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1051 | |
| 1052 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1053 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1054 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 1055 | |
| 1056 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1057 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1058 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, |
| 1059 | InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 1060 | |
| 1061 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1062 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1063 | next_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 1064 | |
| 1065 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1066 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1067 | next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
| 1068 | |
| 1069 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1070 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1071 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 1072 | |
| 1073 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1074 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1075 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1076 | } // std |
| 1077 | |
| 1078 | */ |
| 1079 | |
Louis Dionne | 385cc25 | 2022-03-25 16:55:36 | [diff] [blame] | 1080 | #include <__assert> // all public C++ headers provide the assertion handler |
Arthur O'Dwyer | ea2206d | 2022-02-04 18:09:30 | [diff] [blame] | 1081 | #include <__bits> |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1082 | #include <__config> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1083 | #include <__debug> |
Howard Hinnant | a1d07d5 | 2012-07-26 17:09:09 | [diff] [blame] | 1084 | #include <cstddef> |
Arthur O'Dwyer | bfbd73f | 2021-05-19 15:57:04 | [diff] [blame] | 1085 | #include <cstring> |
Arthur O'Dwyer | bfbd73f | 2021-05-19 15:57:04 | [diff] [blame] | 1086 | #include <initializer_list> |
Arthur O'Dwyer | bfbd73f | 2021-05-19 15:57:04 | [diff] [blame] | 1087 | #include <memory> |
| 1088 | #include <type_traits> |
Marshall Clow | f56972e | 2018-09-12 19:41:40 | [diff] [blame] | 1089 | #include <version> |
Howard Hinnant | 5d1a701 | 2013-08-14 18:00:20 | [diff] [blame] | 1090 | |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1091 | #include <__algorithm/adjacent_find.h> |
| 1092 | #include <__algorithm/all_of.h> |
| 1093 | #include <__algorithm/any_of.h> |
| 1094 | #include <__algorithm/binary_search.h> |
| 1095 | #include <__algorithm/clamp.h> |
| 1096 | #include <__algorithm/comp.h> |
| 1097 | #include <__algorithm/comp_ref_type.h> |
| 1098 | #include <__algorithm/copy.h> |
| 1099 | #include <__algorithm/copy_backward.h> |
| 1100 | #include <__algorithm/copy_if.h> |
| 1101 | #include <__algorithm/copy_n.h> |
| 1102 | #include <__algorithm/count.h> |
| 1103 | #include <__algorithm/count_if.h> |
| 1104 | #include <__algorithm/equal.h> |
| 1105 | #include <__algorithm/equal_range.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1106 | #include <__algorithm/fill.h> |
Arthur O'Dwyer | 4d81a46 | 2022-01-07 14:45:05 | [diff] [blame] | 1107 | #include <__algorithm/fill_n.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1108 | #include <__algorithm/find.h> |
| 1109 | #include <__algorithm/find_end.h> |
| 1110 | #include <__algorithm/find_first_of.h> |
| 1111 | #include <__algorithm/find_if.h> |
| 1112 | #include <__algorithm/find_if_not.h> |
| 1113 | #include <__algorithm/for_each.h> |
| 1114 | #include <__algorithm/for_each_n.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1115 | #include <__algorithm/generate.h> |
Arthur O'Dwyer | 4d81a46 | 2022-01-07 14:45:05 | [diff] [blame] | 1116 | #include <__algorithm/generate_n.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1117 | #include <__algorithm/half_positive.h> |
Nikolas Klauser | 68f4131 | 2022-02-21 22:07:02 | [diff] [blame] | 1118 | #include <__algorithm/in_found_result.h> |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 1119 | #include <__algorithm/in_fun_result.h> |
Nikolas Klauser | f3514af | 2022-01-25 10:21:47 | [diff] [blame] | 1120 | #include <__algorithm/in_in_out_result.h> |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 1121 | #include <__algorithm/in_in_result.h> |
Nikolas Klauser | 610979b | 2022-02-03 01:17:03 | [diff] [blame] | 1122 | #include <__algorithm/in_out_out_result.h> |
Konstantin Varlamov | 8d23b74 | 2022-01-11 06:49:37 | [diff] [blame] | 1123 | #include <__algorithm/in_out_result.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1124 | #include <__algorithm/includes.h> |
| 1125 | #include <__algorithm/inplace_merge.h> |
| 1126 | #include <__algorithm/is_heap.h> |
| 1127 | #include <__algorithm/is_heap_until.h> |
| 1128 | #include <__algorithm/is_partitioned.h> |
| 1129 | #include <__algorithm/is_permutation.h> |
| 1130 | #include <__algorithm/is_sorted.h> |
| 1131 | #include <__algorithm/is_sorted_until.h> |
Christopher Di Bella | 6adbc83 | 2021-06-05 02:47:47 | [diff] [blame] | 1132 | #include <__algorithm/iter_swap.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1133 | #include <__algorithm/lexicographical_compare.h> |
| 1134 | #include <__algorithm/lower_bound.h> |
| 1135 | #include <__algorithm/make_heap.h> |
| 1136 | #include <__algorithm/max.h> |
| 1137 | #include <__algorithm/max_element.h> |
| 1138 | #include <__algorithm/merge.h> |
| 1139 | #include <__algorithm/min.h> |
| 1140 | #include <__algorithm/min_element.h> |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 1141 | #include <__algorithm/min_max_result.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1142 | #include <__algorithm/minmax.h> |
| 1143 | #include <__algorithm/minmax_element.h> |
| 1144 | #include <__algorithm/mismatch.h> |
| 1145 | #include <__algorithm/move.h> |
| 1146 | #include <__algorithm/move_backward.h> |
| 1147 | #include <__algorithm/next_permutation.h> |
| 1148 | #include <__algorithm/none_of.h> |
| 1149 | #include <__algorithm/nth_element.h> |
| 1150 | #include <__algorithm/partial_sort.h> |
| 1151 | #include <__algorithm/partial_sort_copy.h> |
| 1152 | #include <__algorithm/partition.h> |
| 1153 | #include <__algorithm/partition_copy.h> |
| 1154 | #include <__algorithm/partition_point.h> |
| 1155 | #include <__algorithm/pop_heap.h> |
| 1156 | #include <__algorithm/prev_permutation.h> |
| 1157 | #include <__algorithm/push_heap.h> |
Nikolas Klauser | 916e905 | 2022-06-08 10:14:12 | [diff] [blame] | 1158 | #include <__algorithm/ranges_adjacent_find.h> |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 1159 | #include <__algorithm/ranges_all_of.h> |
| 1160 | #include <__algorithm/ranges_any_of.h> |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 1161 | #include <__algorithm/ranges_binary_search.h> |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 1162 | #include <__algorithm/ranges_copy.h> |
| 1163 | #include <__algorithm/ranges_copy_backward.h> |
| 1164 | #include <__algorithm/ranges_copy_if.h> |
| 1165 | #include <__algorithm/ranges_copy_n.h> |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 1166 | #include <__algorithm/ranges_count.h> |
| 1167 | #include <__algorithm/ranges_count_if.h> |
Nikolas Klauser | 569d663 | 2022-05-25 09:09:43 | [diff] [blame] | 1168 | #include <__algorithm/ranges_equal.h> |
Nikolas Klauser | 7af89a3 | 2022-05-21 16:26:29 | [diff] [blame] | 1169 | #include <__algorithm/ranges_fill.h> |
| 1170 | #include <__algorithm/ranges_fill_n.h> |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 1171 | #include <__algorithm/ranges_find.h> |
Nikolas Klauser | b79b2b6 | 2022-06-06 11:57:34 | [diff] [blame] | 1172 | #include <__algorithm/ranges_find_first_of.h> |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 1173 | #include <__algorithm/ranges_find_if.h> |
| 1174 | #include <__algorithm/ranges_find_if_not.h> |
Nikolas Klauser | 80045e9 | 2022-05-04 18:27:07 | [diff] [blame] | 1175 | #include <__algorithm/ranges_for_each.h> |
| 1176 | #include <__algorithm/ranges_for_each_n.h> |
Nikolas Klauser | 37ba1b9 | 2022-05-04 12:19:09 | [diff] [blame] | 1177 | #include <__algorithm/ranges_is_partitioned.h> |
Nikolas Klauser | 11e3ad2 | 2022-05-26 14:08:55 | [diff] [blame] | 1178 | #include <__algorithm/ranges_is_sorted.h> |
| 1179 | #include <__algorithm/ranges_is_sorted_until.h> |
Nikolas Klauser | afd5a4f | 2022-06-15 14:24:43 | [diff] [blame^] | 1180 | #include <__algorithm/ranges_lexicographical_compare.h> |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 1181 | #include <__algorithm/ranges_lower_bound.h> |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 1182 | #include <__algorithm/ranges_max.h> |
Nikolas Klauser | 205557c | 2022-03-07 16:01:52 | [diff] [blame] | 1183 | #include <__algorithm/ranges_max_element.h> |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 1184 | #include <__algorithm/ranges_min.h> |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 1185 | #include <__algorithm/ranges_min_element.h> |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 1186 | #include <__algorithm/ranges_minmax.h> |
| 1187 | #include <__algorithm/ranges_minmax_element.h> |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 1188 | #include <__algorithm/ranges_mismatch.h> |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 1189 | #include <__algorithm/ranges_none_of.h> |
Nikolas Klauser | ff6d5de | 2022-06-07 07:42:10 | [diff] [blame] | 1190 | #include <__algorithm/ranges_replace.h> |
| 1191 | #include <__algorithm/ranges_replace_if.h> |
Nikolas Klauser | 1d1a191 | 2022-05-24 08:32:50 | [diff] [blame] | 1192 | #include <__algorithm/ranges_reverse.h> |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 1193 | #include <__algorithm/ranges_swap_ranges.h> |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 1194 | #include <__algorithm/ranges_transform.h> |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 1195 | #include <__algorithm/ranges_upper_bound.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1196 | #include <__algorithm/remove.h> |
| 1197 | #include <__algorithm/remove_copy.h> |
| 1198 | #include <__algorithm/remove_copy_if.h> |
| 1199 | #include <__algorithm/remove_if.h> |
| 1200 | #include <__algorithm/replace.h> |
| 1201 | #include <__algorithm/replace_copy.h> |
| 1202 | #include <__algorithm/replace_copy_if.h> |
| 1203 | #include <__algorithm/replace_if.h> |
| 1204 | #include <__algorithm/reverse.h> |
| 1205 | #include <__algorithm/reverse_copy.h> |
| 1206 | #include <__algorithm/rotate.h> |
| 1207 | #include <__algorithm/rotate_copy.h> |
| 1208 | #include <__algorithm/sample.h> |
| 1209 | #include <__algorithm/search.h> |
| 1210 | #include <__algorithm/search_n.h> |
| 1211 | #include <__algorithm/set_difference.h> |
| 1212 | #include <__algorithm/set_intersection.h> |
| 1213 | #include <__algorithm/set_symmetric_difference.h> |
| 1214 | #include <__algorithm/set_union.h> |
| 1215 | #include <__algorithm/shift_left.h> |
| 1216 | #include <__algorithm/shift_right.h> |
| 1217 | #include <__algorithm/shuffle.h> |
| 1218 | #include <__algorithm/sift_down.h> |
| 1219 | #include <__algorithm/sort.h> |
| 1220 | #include <__algorithm/sort_heap.h> |
| 1221 | #include <__algorithm/stable_partition.h> |
| 1222 | #include <__algorithm/stable_sort.h> |
Christopher Di Bella | 6adbc83 | 2021-06-05 02:47:47 | [diff] [blame] | 1223 | #include <__algorithm/swap_ranges.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1224 | #include <__algorithm/transform.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1225 | #include <__algorithm/unique.h> |
Arthur O'Dwyer | 4d81a46 | 2022-01-07 14:45:05 | [diff] [blame] | 1226 | #include <__algorithm/unique_copy.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1227 | #include <__algorithm/unwrap_iter.h> |
| 1228 | #include <__algorithm/upper_bound.h> |
Eric Fiselier | c1bd919 | 2014-08-10 23:53:08 | [diff] [blame] | 1229 | |
Howard Hinnant | 073458b | 2011-10-17 20:05:10 | [diff] [blame] | 1230 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Arthur O'Dwyer | fa6b9e4 | 2022-02-02 01:16:40 | [diff] [blame] | 1231 | # pragma GCC system_header |
Howard Hinnant | 073458b | 2011-10-17 20:05:10 | [diff] [blame] | 1232 | #endif |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1233 | |
Louis Dionne | 0a06eb9 | 2019-08-05 18:29:14 | [diff] [blame] | 1234 | #if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17 |
Louis Dionne | 9568924 | 2019-08-06 21:11:24 | [diff] [blame] | 1235 | # include <__pstl_algorithm> |
Louis Dionne | 0a06eb9 | 2019-08-05 18:29:14 | [diff] [blame] | 1236 | #endif |
| 1237 | |
Louis Dionne | 4cd6ca1 | 2021-04-20 16:03:32 | [diff] [blame] | 1238 | #endif // _LIBCPP_ALGORITHM |