Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
Louis Dionne | 9bd9388 | 2021-11-17 16:25:01 -0500 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 3 | // |
Chandler Carruth | d201210 | 2019-01-19 10:56:40 +0000 | [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 | c51e102 | 2010-05-11 19:42:16 +0000 | [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 | f74be4e | 2022-01-14 02:55:51 +0100 | [diff] [blame] | 21 | namespace ranges { |
Nikolas Klauser | 671b475 | 2022-02-11 17:01:58 +0100 | [diff] [blame] | 22 | template <class I, class F> |
Nikolas Klauser | 2e26316 | 2022-02-21 22:48:36 +0100 | [diff] [blame] | 23 | struct in_fun_result; // since C++20 |
Nikolas Klauser | 671b475 | 2022-02-11 17:01:58 +0100 | [diff] [blame] | 24 | |
Nikolas Klauser | f74be4e | 2022-01-14 02:55:51 +0100 | [diff] [blame] | 25 | template <class I1, class I2> |
Nikolas Klauser | 2e26316 | 2022-02-21 22:48:36 +0100 | [diff] [blame] | 26 | struct in_in_result; // since C++20 |
Nikolas Klauser | 05e2cd8 | 2022-01-25 11:21:47 +0100 | [diff] [blame] | 27 | |
| 28 | template <class I1, class I2, class O> |
Nikolas Klauser | 2e26316 | 2022-02-21 22:48:36 +0100 | [diff] [blame] | 29 | struct in_in_out_result; // since C++20 |
Nikolas Klauser | 61ce816 | 2022-02-03 02:17:03 +0100 | [diff] [blame] | 30 | |
| 31 | template <class I, class O1, class O2> |
| 32 | struct in_out_out_result; // since C++20 |
Nikolas Klauser | 671b475 | 2022-02-11 17:01:58 +0100 | [diff] [blame] | 33 | |
Nikolas Klauser | 2e26316 | 2022-02-21 22:48:36 +0100 | [diff] [blame] | 34 | template <class I1, class I2> |
| 35 | struct min_max_result; // since C++20 |
| 36 | |
Nikolas Klauser | dd5ad21 | 2022-02-21 23:07:02 +0100 | [diff] [blame] | 37 | template <class I> |
| 38 | struct in_found_result; // since C++20 |
| 39 | |
Nikolas Klauser | 0a62a17 | 2022-02-11 13:11:57 +0100 | [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 | 12fc9bf | 2022-03-08 23:12:35 +0100 | [diff] [blame] | 47 | |
Nikolas Klauser | 10c612d | 2022-05-22 13:43:37 +0200 | [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 | 12fc9bf | 2022-03-08 23:12:35 +0100 | [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 | 37d076e | 2022-03-12 01:45:35 +0100 | [diff] [blame] | 68 | |
Nikolas Klauser | 37d076e | 2022-03-12 01:45:35 +0100 | [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 | 3559e45 | 2022-03-18 02:57:08 +0100 | [diff] [blame] | 94 | |
Nikolas Klauser | 573cd6f | 2022-04-03 09:17:01 +0200 | [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 | 3559e45 | 2022-03-18 02:57:08 +0100 | [diff] [blame] | 98 | |
Nikolas Klauser | 573cd6f | 2022-04-03 09:17:01 +0200 | [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 | 3559e45 | 2022-03-18 02:57:08 +0100 | [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 | 573cd6f | 2022-04-03 09:17:01 +0200 | [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 | 559a177 | 2022-04-05 11:05:36 +0200 | [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 | f1373d0 | 2022-04-07 13:02:02 +0200 | [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 | 0a2f44f | 2022-04-13 22:59:09 +0200 | [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 | d959d84 | 2022-04-15 13:43:40 +0200 | [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 | 58de98c | 2022-05-04 20:27:07 +0200 | [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 | bb9049d | 2022-05-04 14:19:09 +0200 | [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 | f74be4e | 2022-01-14 02:55:51 +0100 | [diff] [blame] | 277 | } |
| 278 | |
Marshall Clow | d607fdb | 2018-01-15 17:20:36 +0000 | [diff] [blame] | 279 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 280 | all_of(InputIterator first, InputIterator last, Predicate pred); |
| 281 | |
| 282 | template <class InputIterator, class Predicate> |
Marshall Clow | d607fdb | 2018-01-15 17:20:36 +0000 | [diff] [blame] | 283 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 284 | any_of(InputIterator first, InputIterator last, Predicate pred); |
| 285 | |
| 286 | template <class InputIterator, class Predicate> |
Marshall Clow | d607fdb | 2018-01-15 17:20:36 +0000 | [diff] [blame] | 287 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 288 | none_of(InputIterator first, InputIterator last, Predicate pred); |
| 289 | |
| 290 | template <class InputIterator, class Function> |
Marshall Clow | 5492c8a | 2018-01-22 20:44:33 +0000 | [diff] [blame] | 291 | constexpr Function // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 292 | for_each(InputIterator first, InputIterator last, Function f); |
| 293 | |
Marshall Clow | de0169c | 2017-05-25 02:29:54 +0000 | [diff] [blame] | 294 | template<class InputIterator, class Size, class Function> |
Marshall Clow | 5492c8a | 2018-01-22 20:44:33 +0000 | [diff] [blame] | 295 | constexpr InputIterator // constexpr in C++20 |
| 296 | for_each_n(InputIterator first, Size n, Function f); // C++17 |
Marshall Clow | de0169c | 2017-05-25 02:29:54 +0000 | [diff] [blame] | 297 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 298 | template <class InputIterator, class T> |
Marshall Clow | ee0161e | 2018-01-15 19:26:05 +0000 | [diff] [blame] | 299 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 300 | find(InputIterator first, InputIterator last, const T& value); |
| 301 | |
| 302 | template <class InputIterator, class Predicate> |
Marshall Clow | ee0161e | 2018-01-15 19:26:05 +0000 | [diff] [blame] | 303 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 304 | find_if(InputIterator first, InputIterator last, Predicate pred); |
| 305 | |
| 306 | template<class InputIterator, class Predicate> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 307 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 308 | find_if_not(InputIterator first, InputIterator last, Predicate pred); |
| 309 | |
| 310 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 311 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 312 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 313 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 314 | |
| 315 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 316 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 317 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 318 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 319 | |
| 320 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | ee0161e | 2018-01-15 19:26:05 +0000 | [diff] [blame] | 321 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 322 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 323 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 324 | |
| 325 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | ee0161e | 2018-01-15 19:26:05 +0000 | [diff] [blame] | 326 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 327 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 328 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 329 | |
| 330 | template <class ForwardIterator> |
Marshall Clow | ee0161e | 2018-01-15 19:26:05 +0000 | [diff] [blame] | 331 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 332 | adjacent_find(ForwardIterator first, ForwardIterator last); |
| 333 | |
| 334 | template <class ForwardIterator, class BinaryPredicate> |
Marshall Clow | ee0161e | 2018-01-15 19:26:05 +0000 | [diff] [blame] | 335 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 336 | adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 337 | |
| 338 | template <class InputIterator, class T> |
Marshall Clow | 3c0558f | 2018-01-15 19:40:34 +0000 | [diff] [blame] | 339 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 340 | count(InputIterator first, InputIterator last, const T& value); |
| 341 | |
| 342 | template <class InputIterator, class Predicate> |
Marshall Clow | 3c0558f | 2018-01-15 19:40:34 +0000 | [diff] [blame] | 343 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 344 | count_if(InputIterator first, InputIterator last, Predicate pred); |
| 345 | |
| 346 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 30bf302 | 2018-01-16 02:04:10 +0000 | [diff] [blame] | 347 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 348 | mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 349 | |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 350 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 30bf302 | 2018-01-16 02:04:10 +0000 | [diff] [blame] | 351 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Aditya Kumar | 3a0179a | 2016-08-25 11:52:38 +0000 | [diff] [blame] | 352 | mismatch(InputIterator1 first1, InputIterator1 last1, |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 353 | InputIterator2 first2, InputIterator2 last2); // **C++14** |
| 354 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 355 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 30bf302 | 2018-01-16 02:04:10 +0000 | [diff] [blame] | 356 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 357 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 358 | InputIterator2 first2, BinaryPredicate pred); |
| 359 | |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 360 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 30bf302 | 2018-01-16 02:04:10 +0000 | [diff] [blame] | 361 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 362 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 363 | InputIterator2 first2, InputIterator2 last2, |
| 364 | BinaryPredicate pred); // **C++14** |
| 365 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 366 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 30bf302 | 2018-01-16 02:04:10 +0000 | [diff] [blame] | 367 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 368 | equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 369 | |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 370 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 30bf302 | 2018-01-16 02:04:10 +0000 | [diff] [blame] | 371 | constexpr bool // constexpr in C++20 |
Aditya Kumar | 3a0179a | 2016-08-25 11:52:38 +0000 | [diff] [blame] | 372 | equal(InputIterator1 first1, InputIterator1 last1, |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 373 | InputIterator2 first2, InputIterator2 last2); // **C++14** |
| 374 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 375 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 30bf302 | 2018-01-16 02:04:10 +0000 | [diff] [blame] | 376 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 377 | equal(InputIterator1 first1, InputIterator1 last1, |
| 378 | InputIterator2 first2, BinaryPredicate pred); |
| 379 | |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 380 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 30bf302 | 2018-01-16 02:04:10 +0000 | [diff] [blame] | 381 | constexpr bool // constexpr in C++20 |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 382 | equal(InputIterator1 first1, InputIterator1 last1, |
| 383 | InputIterator2 first2, InputIterator2 last2, |
| 384 | BinaryPredicate pred); // **C++14** |
| 385 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 386 | template<class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 387 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 388 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 389 | ForwardIterator2 first2); |
| 390 | |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 391 | template<class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 392 | constexpr bool // constexpr in C++20 |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 393 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 394 | ForwardIterator2 first2, ForwardIterator2 last2); // **C++14** |
| 395 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 396 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 397 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 398 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 399 | ForwardIterator2 first2, BinaryPredicate pred); |
| 400 | |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 401 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 402 | constexpr bool // constexpr in C++20 |
Marshall Clow | 96b42b2 | 2013-05-09 21:14:23 +0000 | [diff] [blame] | 403 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 404 | ForwardIterator2 first2, ForwardIterator2 last2, |
| 405 | BinaryPredicate pred); // **C++14** |
| 406 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 407 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 323fc5b | 2018-01-16 15:48:27 +0000 | [diff] [blame] | 408 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 409 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 410 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 411 | |
| 412 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 323fc5b | 2018-01-16 15:48:27 +0000 | [diff] [blame] | 413 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 414 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 415 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 416 | |
| 417 | template <class ForwardIterator, class Size, class T> |
Marshall Clow | 323fc5b | 2018-01-16 15:48:27 +0000 | [diff] [blame] | 418 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 419 | search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); |
| 420 | |
| 421 | template <class ForwardIterator, class Size, class T, class BinaryPredicate> |
Marshall Clow | 323fc5b | 2018-01-16 15:48:27 +0000 | [diff] [blame] | 422 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 423 | search_n(ForwardIterator first, ForwardIterator last, |
| 424 | Size count, const T& value, BinaryPredicate pred); |
| 425 | |
| 426 | template <class InputIterator, class OutputIterator> |
Louis Dionne | 65b433b | 2019-11-06 12:02:41 +0000 | [diff] [blame] | 427 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 428 | copy(InputIterator first, InputIterator last, OutputIterator result); |
| 429 | |
| 430 | template<class InputIterator, class OutputIterator, class Predicate> |
Louis Dionne | 65b433b | 2019-11-06 12:02:41 +0000 | [diff] [blame] | 431 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 432 | copy_if(InputIterator first, InputIterator last, |
| 433 | OutputIterator result, Predicate pred); |
| 434 | |
| 435 | template<class InputIterator, class Size, class OutputIterator> |
Louis Dionne | 65b433b | 2019-11-06 12:02:41 +0000 | [diff] [blame] | 436 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 437 | copy_n(InputIterator first, Size n, OutputIterator result); |
| 438 | |
| 439 | template <class BidirectionalIterator1, class BidirectionalIterator2> |
Louis Dionne | 65b433b | 2019-11-06 12:02:41 +0000 | [diff] [blame] | 440 | constexpr BidirectionalIterator2 // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 441 | copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, |
| 442 | BidirectionalIterator2 result); |
| 443 | |
| 444 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 445 | constexpr ForwardIterator2 // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 446 | swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); |
| 447 | |
Nikolas Klauser | 4ceab5f | 2022-02-10 13:33:03 +0100 | [diff] [blame] | 448 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2> |
| 449 | requires indirectly_swappable<I1, I2> |
| 450 | constexpr ranges::swap_ranges_result<I1, I2> |
| 451 | ranges::swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2); |
| 452 | |
| 453 | template<input_range R1, input_range R2> |
| 454 | requires indirectly_swappable<iterator_t<R1>, iterator_t<R2>> |
| 455 | constexpr ranges::swap_ranges_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
| 456 | ranges::swap_ranges(R1&& r1, R2&& r2); |
| 457 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 458 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 459 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 460 | iter_swap(ForwardIterator1 a, ForwardIterator2 b); |
| 461 | |
| 462 | template <class InputIterator, class OutputIterator, class UnaryOperation> |
Marshall Clow | 31427c6 | 2018-01-19 17:45:39 +0000 | [diff] [blame] | 463 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 464 | transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op); |
| 465 | |
| 466 | template <class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation> |
Marshall Clow | 31427c6 | 2018-01-19 17:45:39 +0000 | [diff] [blame] | 467 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 468 | transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, |
| 469 | OutputIterator result, BinaryOperation binary_op); |
| 470 | |
| 471 | template <class ForwardIterator, class T> |
Marshall Clow | 01bbbd2 | 2018-01-19 18:07:29 +0000 | [diff] [blame] | 472 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 473 | replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value); |
| 474 | |
| 475 | template <class ForwardIterator, class Predicate, class T> |
Marshall Clow | 01bbbd2 | 2018-01-19 18:07:29 +0000 | [diff] [blame] | 476 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 477 | replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value); |
| 478 | |
| 479 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | 01bbbd2 | 2018-01-19 18:07:29 +0000 | [diff] [blame] | 480 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 481 | replace_copy(InputIterator first, InputIterator last, OutputIterator result, |
| 482 | const T& old_value, const T& new_value); |
| 483 | |
| 484 | template <class InputIterator, class OutputIterator, class Predicate, class T> |
Marshall Clow | 01bbbd2 | 2018-01-19 18:07:29 +0000 | [diff] [blame] | 485 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 486 | replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value); |
| 487 | |
| 488 | template <class ForwardIterator, class T> |
Marshall Clow | e9cdc5c | 2018-01-20 20:14:32 +0000 | [diff] [blame] | 489 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 490 | fill(ForwardIterator first, ForwardIterator last, const T& value); |
| 491 | |
| 492 | template <class OutputIterator, class Size, class T> |
Marshall Clow | e9cdc5c | 2018-01-20 20:14:32 +0000 | [diff] [blame] | 493 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 494 | fill_n(OutputIterator first, Size n, const T& value); |
| 495 | |
| 496 | template <class ForwardIterator, class Generator> |
Marshall Clow | e9cdc5c | 2018-01-20 20:14:32 +0000 | [diff] [blame] | 497 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 498 | generate(ForwardIterator first, ForwardIterator last, Generator gen); |
| 499 | |
| 500 | template <class OutputIterator, class Size, class Generator> |
Marshall Clow | e9cdc5c | 2018-01-20 20:14:32 +0000 | [diff] [blame] | 501 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 502 | generate_n(OutputIterator first, Size n, Generator gen); |
| 503 | |
| 504 | template <class ForwardIterator, class T> |
Marshall Clow | 7c0fbd8 | 2018-01-22 21:43:04 +0000 | [diff] [blame] | 505 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 506 | remove(ForwardIterator first, ForwardIterator last, const T& value); |
| 507 | |
| 508 | template <class ForwardIterator, class Predicate> |
Marshall Clow | 7c0fbd8 | 2018-01-22 21:43:04 +0000 | [diff] [blame] | 509 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 510 | remove_if(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 511 | |
| 512 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | 7c0fbd8 | 2018-01-22 21:43:04 +0000 | [diff] [blame] | 513 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 514 | remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); |
| 515 | |
| 516 | template <class InputIterator, class OutputIterator, class Predicate> |
Marshall Clow | 7c0fbd8 | 2018-01-22 21:43:04 +0000 | [diff] [blame] | 517 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 518 | remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); |
| 519 | |
| 520 | template <class ForwardIterator> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 521 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 522 | unique(ForwardIterator first, ForwardIterator last); |
| 523 | |
| 524 | template <class ForwardIterator, class BinaryPredicate> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 525 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 526 | unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 527 | |
| 528 | template <class InputIterator, class OutputIterator> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 529 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 530 | unique_copy(InputIterator first, InputIterator last, OutputIterator result); |
| 531 | |
| 532 | template <class InputIterator, class OutputIterator, class BinaryPredicate> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 533 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 534 | unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred); |
| 535 | |
| 536 | template <class BidirectionalIterator> |
Arthur O'Dwyer | e50e747 | 2020-12-17 00:01:08 -0500 | [diff] [blame] | 537 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 538 | reverse(BidirectionalIterator first, BidirectionalIterator last); |
| 539 | |
| 540 | template <class BidirectionalIterator, class OutputIterator> |
Marshall Clow | 7c0fbd8 | 2018-01-22 21:43:04 +0000 | [diff] [blame] | 541 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 542 | reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); |
| 543 | |
| 544 | template <class ForwardIterator> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 545 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 546 | rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last); |
| 547 | |
| 548 | template <class ForwardIterator, class OutputIterator> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 549 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 550 | rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result); |
| 551 | |
| 552 | template <class RandomAccessIterator> |
| 553 | void |
Marshall Clow | fac06e5 | 2017-03-23 13:43:37 +0000 | [diff] [blame] | 554 | random_shuffle(RandomAccessIterator first, RandomAccessIterator last); // deprecated in C++14, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 555 | |
| 556 | template <class RandomAccessIterator, class RandomNumberGenerator> |
| 557 | void |
Marshall Clow | 83f3539 | 2014-03-03 06:14:19 +0000 | [diff] [blame] | 558 | random_shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Marshall Clow | fac06e5 | 2017-03-23 13:43:37 +0000 | [diff] [blame] | 559 | RandomNumberGenerator& rand); // deprecated in C++14, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 560 | |
Eric Fiselier | 1208fcd | 2016-08-28 22:14:37 +0000 | [diff] [blame] | 561 | template<class PopulationIterator, class SampleIterator, |
| 562 | class Distance, class UniformRandomBitGenerator> |
| 563 | SampleIterator sample(PopulationIterator first, PopulationIterator last, |
| 564 | SampleIterator out, Distance n, |
| 565 | UniformRandomBitGenerator&& g); // C++17 |
| 566 | |
Howard Hinnant | 578ac0f | 2010-05-26 17:49:34 +0000 | [diff] [blame] | 567 | template<class RandomAccessIterator, class UniformRandomNumberGenerator> |
| 568 | void shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Howard Hinnant | a5e7178 | 2010-11-18 01:47:02 +0000 | [diff] [blame] | 569 | UniformRandomNumberGenerator&& g); |
Howard Hinnant | 578ac0f | 2010-05-26 17:49:34 +0000 | [diff] [blame] | 570 | |
Arthur O'Dwyer | cea050d | 2020-12-26 01:39:03 -0500 | [diff] [blame] | 571 | template<class ForwardIterator> |
| 572 | constexpr ForwardIterator |
| 573 | shift_left(ForwardIterator first, ForwardIterator last, |
| 574 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 575 | |
| 576 | template<class ForwardIterator> |
| 577 | constexpr ForwardIterator |
| 578 | shift_right(ForwardIterator first, ForwardIterator last, |
| 579 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 580 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 581 | template <class InputIterator, class Predicate> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 582 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 583 | is_partitioned(InputIterator first, InputIterator last, Predicate pred); |
| 584 | |
| 585 | template <class ForwardIterator, class Predicate> |
Arthur O'Dwyer | e50e747 | 2020-12-17 00:01:08 -0500 | [diff] [blame] | 586 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 587 | partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 588 | |
| 589 | template <class InputIterator, class OutputIterator1, |
| 590 | class OutputIterator2, class Predicate> |
Marshall Clow | 5492c8a | 2018-01-22 20:44:33 +0000 | [diff] [blame] | 591 | constexpr pair<OutputIterator1, OutputIterator2> // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 592 | partition_copy(InputIterator first, InputIterator last, |
| 593 | OutputIterator1 out_true, OutputIterator2 out_false, |
| 594 | Predicate pred); |
| 595 | |
| 596 | template <class ForwardIterator, class Predicate> |
| 597 | ForwardIterator |
| 598 | stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 599 | |
| 600 | template<class ForwardIterator, class Predicate> |
Marshall Clow | e00916c | 2018-01-16 02:34:41 +0000 | [diff] [blame] | 601 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 602 | partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 603 | |
| 604 | template <class ForwardIterator> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 605 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 606 | is_sorted(ForwardIterator first, ForwardIterator last); |
| 607 | |
| 608 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 609 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 610 | is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); |
| 611 | |
| 612 | template<class ForwardIterator> |
Marshall Clow | 3c0558f | 2018-01-15 19:40:34 +0000 | [diff] [blame] | 613 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 614 | is_sorted_until(ForwardIterator first, ForwardIterator last); |
| 615 | |
| 616 | template <class ForwardIterator, class Compare> |
Marshall Clow | 3c0558f | 2018-01-15 19:40:34 +0000 | [diff] [blame] | 617 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 618 | is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); |
| 619 | |
| 620 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 1bb0f67 | 2020-12-20 15:21:42 -0500 | [diff] [blame] | 621 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 622 | sort(RandomAccessIterator first, RandomAccessIterator last); |
| 623 | |
| 624 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 1bb0f67 | 2020-12-20 15:21:42 -0500 | [diff] [blame] | 625 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 626 | sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 627 | |
| 628 | template <class RandomAccessIterator> |
| 629 | void |
| 630 | stable_sort(RandomAccessIterator first, RandomAccessIterator last); |
| 631 | |
| 632 | template <class RandomAccessIterator, class Compare> |
| 633 | void |
| 634 | stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 635 | |
| 636 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 637 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 638 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last); |
| 639 | |
| 640 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 641 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 642 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); |
| 643 | |
| 644 | template <class InputIterator, class RandomAccessIterator> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 645 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 646 | partial_sort_copy(InputIterator first, InputIterator last, |
| 647 | RandomAccessIterator result_first, RandomAccessIterator result_last); |
| 648 | |
| 649 | template <class InputIterator, class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 650 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 651 | partial_sort_copy(InputIterator first, InputIterator last, |
| 652 | RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp); |
| 653 | |
| 654 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 4f5717b | 2021-02-04 18:12:52 -0500 | [diff] [blame] | 655 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 656 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last); |
| 657 | |
| 658 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 4f5717b | 2021-02-04 18:12:52 -0500 | [diff] [blame] | 659 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 660 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); |
| 661 | |
| 662 | template <class ForwardIterator, class T> |
Marshall Clow | e00916c | 2018-01-16 02:34:41 +0000 | [diff] [blame] | 663 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 664 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 665 | |
| 666 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | e00916c | 2018-01-16 02:34:41 +0000 | [diff] [blame] | 667 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 668 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 669 | |
| 670 | template <class ForwardIterator, class T> |
Marshall Clow | e00916c | 2018-01-16 02:34:41 +0000 | [diff] [blame] | 671 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 672 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 673 | |
| 674 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | e00916c | 2018-01-16 02:34:41 +0000 | [diff] [blame] | 675 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 676 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 677 | |
| 678 | template <class ForwardIterator, class T> |
Marshall Clow | e00916c | 2018-01-16 02:34:41 +0000 | [diff] [blame] | 679 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 680 | equal_range(ForwardIterator first, ForwardIterator last, const T& value); |
| 681 | |
| 682 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | e00916c | 2018-01-16 02:34:41 +0000 | [diff] [blame] | 683 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 684 | equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 685 | |
| 686 | template <class ForwardIterator, class T> |
Marshall Clow | e00916c | 2018-01-16 02:34:41 +0000 | [diff] [blame] | 687 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 688 | binary_search(ForwardIterator first, ForwardIterator last, const T& value); |
| 689 | |
| 690 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | c0b7f97 | 2018-01-22 23:10:40 +0000 | [diff] [blame] | 691 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 692 | binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 693 | |
| 694 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 5afc569 | 2020-12-04 13:47:12 -0500 | [diff] [blame] | 695 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 696 | merge(InputIterator1 first1, InputIterator1 last1, |
| 697 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 698 | |
| 699 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 5afc569 | 2020-12-04 13:47:12 -0500 | [diff] [blame] | 700 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 701 | merge(InputIterator1 first1, InputIterator1 last1, |
| 702 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 703 | |
| 704 | template <class BidirectionalIterator> |
| 705 | void |
| 706 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last); |
| 707 | |
| 708 | template <class BidirectionalIterator, class Compare> |
| 709 | void |
| 710 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp); |
| 711 | |
| 712 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | c0b7f97 | 2018-01-22 23:10:40 +0000 | [diff] [blame] | 713 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 714 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 715 | |
| 716 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | c0b7f97 | 2018-01-22 23:10:40 +0000 | [diff] [blame] | 717 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 718 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 719 | |
| 720 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 5afc569 | 2020-12-04 13:47:12 -0500 | [diff] [blame] | 721 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 722 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 723 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 724 | |
| 725 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 5afc569 | 2020-12-04 13:47:12 -0500 | [diff] [blame] | 726 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 727 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 728 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 729 | |
| 730 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Marshall Clow | c0b7f97 | 2018-01-22 23:10:40 +0000 | [diff] [blame] | 731 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 732 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 733 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 734 | |
| 735 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Marshall Clow | c0b7f97 | 2018-01-22 23:10:40 +0000 | [diff] [blame] | 736 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 737 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 738 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 739 | |
| 740 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 5afc569 | 2020-12-04 13:47:12 -0500 | [diff] [blame] | 741 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 742 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 743 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 744 | |
| 745 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 5afc569 | 2020-12-04 13:47:12 -0500 | [diff] [blame] | 746 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 747 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 748 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 749 | |
| 750 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 5afc569 | 2020-12-04 13:47:12 -0500 | [diff] [blame] | 751 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 752 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 753 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 754 | |
| 755 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 5afc569 | 2020-12-04 13:47:12 -0500 | [diff] [blame] | 756 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 757 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 758 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 759 | |
| 760 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 761 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 762 | push_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 763 | |
| 764 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 765 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 766 | push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 767 | |
| 768 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 769 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 770 | pop_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 771 | |
| 772 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 773 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 774 | pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 775 | |
| 776 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 777 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 778 | make_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 779 | |
| 780 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 781 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 782 | make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 783 | |
| 784 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 785 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 786 | sort_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 787 | |
| 788 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 2dfea5d | 2020-12-17 00:26:18 -0500 | [diff] [blame] | 789 | constexpr void // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 790 | sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 791 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 792 | template <class RandomAccessIterator> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 793 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 794 | is_heap(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 795 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 796 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 797 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 798 | is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 799 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 800 | template <class RandomAccessIterator> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 801 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 802 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 803 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 804 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 96d050a | 2018-01-15 16:16:32 +0000 | [diff] [blame] | 805 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 806 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 807 | |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 808 | template <class ForwardIterator> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 809 | constexpr ForwardIterator // constexpr in C++14 |
| 810 | min_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 811 | |
| 812 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 813 | constexpr ForwardIterator // constexpr in C++14 |
| 814 | min_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 815 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 816 | template <class T> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 817 | constexpr const T& // constexpr in C++14 |
| 818 | min(const T& a, const T& b); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 819 | |
| 820 | template <class T, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 821 | constexpr const T& // constexpr in C++14 |
| 822 | min(const T& a, const T& b, Compare comp); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 823 | |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 824 | template<class T> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 825 | constexpr T // constexpr in C++14 |
| 826 | min(initializer_list<T> t); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 827 | |
| 828 | template<class T, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 829 | constexpr T // constexpr in C++14 |
| 830 | min(initializer_list<T> t, Compare comp); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 831 | |
Marshall Clow | 3e18d0e | 2016-03-07 22:43:49 +0000 | [diff] [blame] | 832 | template<class T> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 833 | constexpr const T& clamp(const T& v, const T& lo, const T& hi); // C++17 |
Marshall Clow | 3e18d0e | 2016-03-07 22:43:49 +0000 | [diff] [blame] | 834 | |
| 835 | template<class T, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 836 | constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp); // C++17 |
Marshall Clow | 3e18d0e | 2016-03-07 22:43:49 +0000 | [diff] [blame] | 837 | |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 838 | template <class ForwardIterator> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 839 | constexpr ForwardIterator // constexpr in C++14 |
| 840 | max_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 841 | |
| 842 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 843 | constexpr ForwardIterator // constexpr in C++14 |
| 844 | max_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 845 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 846 | template <class T> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 847 | constexpr const T& // constexpr in C++14 |
| 848 | max(const T& a, const T& b); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 849 | |
| 850 | template <class T, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 851 | constexpr const T& // constexpr in C++14 |
| 852 | max(const T& a, const T& b, Compare comp); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 853 | |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 854 | template<class T> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 855 | constexpr T // constexpr in C++14 |
| 856 | max(initializer_list<T> t); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 857 | |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 858 | template<class T, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 859 | constexpr T // constexpr in C++14 |
| 860 | max(initializer_list<T> t, Compare comp); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 861 | |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 862 | template<class ForwardIterator> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 863 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 864 | minmax_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 865 | |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 866 | template<class ForwardIterator, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 867 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 868 | minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 869 | |
| 870 | template<class T> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 871 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 872 | minmax(const T& a, const T& b); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 873 | |
| 874 | template<class T, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 875 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 876 | minmax(const T& a, const T& b, Compare comp); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 877 | |
| 878 | template<class T> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 879 | constexpr pair<T, T> // constexpr in C++14 |
| 880 | minmax(initializer_list<T> t); |
Howard Hinnant | b120e7a | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 881 | |
| 882 | template<class T, class Compare> |
Arthur O'Dwyer | 20353a7 | 2020-12-02 20:02:18 -0500 | [diff] [blame] | 883 | constexpr pair<T, T> // constexpr in C++14 |
| 884 | minmax(initializer_list<T> t, Compare comp); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 885 | |
| 886 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 5492c8a | 2018-01-22 20:44:33 +0000 | [diff] [blame] | 887 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 888 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 889 | |
| 890 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | 5492c8a | 2018-01-22 20:44:33 +0000 | [diff] [blame] | 891 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 892 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, |
| 893 | InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 894 | |
| 895 | template <class BidirectionalIterator> |
Arthur O'Dwyer | e50e747 | 2020-12-17 00:01:08 -0500 | [diff] [blame] | 896 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 897 | next_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 898 | |
| 899 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | e50e747 | 2020-12-17 00:01:08 -0500 | [diff] [blame] | 900 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 901 | next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
| 902 | |
| 903 | template <class BidirectionalIterator> |
Arthur O'Dwyer | e50e747 | 2020-12-17 00:01:08 -0500 | [diff] [blame] | 904 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 905 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 906 | |
| 907 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | e50e747 | 2020-12-17 00:01:08 -0500 | [diff] [blame] | 908 | constexpr bool // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 909 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 910 | } // std |
| 911 | |
| 912 | */ |
| 913 | |
Louis Dionne | b4fce35 | 2022-03-25 12:55:36 -0400 | [diff] [blame] | 914 | #include <__assert> // all public C++ headers provide the assertion handler |
Arthur O'Dwyer | 3693d7a | 2022-02-04 13:09:30 -0500 | [diff] [blame] | 915 | #include <__bits> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 916 | #include <__config> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 917 | #include <__debug> |
Howard Hinnant | 60e5cf4 | 2012-07-26 17:09:09 +0000 | [diff] [blame] | 918 | #include <cstddef> |
Arthur O'Dwyer | ef18160 | 2021-05-19 11:57:04 -0400 | [diff] [blame] | 919 | #include <cstring> |
Arthur O'Dwyer | ef18160 | 2021-05-19 11:57:04 -0400 | [diff] [blame] | 920 | #include <initializer_list> |
| 921 | #include <iterator> |
| 922 | #include <memory> |
| 923 | #include <type_traits> |
Marshall Clow | 0a1e750 | 2018-09-12 19:41:40 +0000 | [diff] [blame] | 924 | #include <version> |
Howard Hinnant | ea38295 | 2013-08-14 18:00:20 +0000 | [diff] [blame] | 925 | |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 926 | #include <__algorithm/adjacent_find.h> |
| 927 | #include <__algorithm/all_of.h> |
| 928 | #include <__algorithm/any_of.h> |
| 929 | #include <__algorithm/binary_search.h> |
| 930 | #include <__algorithm/clamp.h> |
| 931 | #include <__algorithm/comp.h> |
| 932 | #include <__algorithm/comp_ref_type.h> |
| 933 | #include <__algorithm/copy.h> |
| 934 | #include <__algorithm/copy_backward.h> |
| 935 | #include <__algorithm/copy_if.h> |
| 936 | #include <__algorithm/copy_n.h> |
| 937 | #include <__algorithm/count.h> |
| 938 | #include <__algorithm/count_if.h> |
| 939 | #include <__algorithm/equal.h> |
| 940 | #include <__algorithm/equal_range.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 941 | #include <__algorithm/fill.h> |
Arthur O'Dwyer | 65077c0 | 2022-01-07 09:45:05 -0500 | [diff] [blame] | 942 | #include <__algorithm/fill_n.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 943 | #include <__algorithm/find.h> |
| 944 | #include <__algorithm/find_end.h> |
| 945 | #include <__algorithm/find_first_of.h> |
| 946 | #include <__algorithm/find_if.h> |
| 947 | #include <__algorithm/find_if_not.h> |
| 948 | #include <__algorithm/for_each.h> |
| 949 | #include <__algorithm/for_each_n.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 950 | #include <__algorithm/generate.h> |
Arthur O'Dwyer | 65077c0 | 2022-01-07 09:45:05 -0500 | [diff] [blame] | 951 | #include <__algorithm/generate_n.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 952 | #include <__algorithm/half_positive.h> |
Nikolas Klauser | dd5ad21 | 2022-02-21 23:07:02 +0100 | [diff] [blame] | 953 | #include <__algorithm/in_found_result.h> |
Nikolas Klauser | 671b475 | 2022-02-11 17:01:58 +0100 | [diff] [blame] | 954 | #include <__algorithm/in_fun_result.h> |
Nikolas Klauser | 05e2cd8 | 2022-01-25 11:21:47 +0100 | [diff] [blame] | 955 | #include <__algorithm/in_in_out_result.h> |
Nikolas Klauser | f74be4e | 2022-01-14 02:55:51 +0100 | [diff] [blame] | 956 | #include <__algorithm/in_in_result.h> |
Nikolas Klauser | 61ce816 | 2022-02-03 02:17:03 +0100 | [diff] [blame] | 957 | #include <__algorithm/in_out_out_result.h> |
Konstantin Varlamov | 7473681 | 2022-01-10 22:49:37 -0800 | [diff] [blame] | 958 | #include <__algorithm/in_out_result.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 959 | #include <__algorithm/includes.h> |
| 960 | #include <__algorithm/inplace_merge.h> |
| 961 | #include <__algorithm/is_heap.h> |
| 962 | #include <__algorithm/is_heap_until.h> |
| 963 | #include <__algorithm/is_partitioned.h> |
| 964 | #include <__algorithm/is_permutation.h> |
| 965 | #include <__algorithm/is_sorted.h> |
| 966 | #include <__algorithm/is_sorted_until.h> |
Christopher Di Bella | 41f26e8 | 2021-06-05 02:47:47 +0000 | [diff] [blame] | 967 | #include <__algorithm/iter_swap.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 968 | #include <__algorithm/lexicographical_compare.h> |
| 969 | #include <__algorithm/lower_bound.h> |
| 970 | #include <__algorithm/make_heap.h> |
| 971 | #include <__algorithm/max.h> |
| 972 | #include <__algorithm/max_element.h> |
| 973 | #include <__algorithm/merge.h> |
| 974 | #include <__algorithm/min.h> |
| 975 | #include <__algorithm/min_element.h> |
Nikolas Klauser | 2e26316 | 2022-02-21 22:48:36 +0100 | [diff] [blame] | 976 | #include <__algorithm/min_max_result.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 977 | #include <__algorithm/minmax.h> |
| 978 | #include <__algorithm/minmax_element.h> |
| 979 | #include <__algorithm/mismatch.h> |
| 980 | #include <__algorithm/move.h> |
| 981 | #include <__algorithm/move_backward.h> |
| 982 | #include <__algorithm/next_permutation.h> |
| 983 | #include <__algorithm/none_of.h> |
| 984 | #include <__algorithm/nth_element.h> |
| 985 | #include <__algorithm/partial_sort.h> |
| 986 | #include <__algorithm/partial_sort_copy.h> |
| 987 | #include <__algorithm/partition.h> |
| 988 | #include <__algorithm/partition_copy.h> |
| 989 | #include <__algorithm/partition_point.h> |
| 990 | #include <__algorithm/pop_heap.h> |
| 991 | #include <__algorithm/prev_permutation.h> |
| 992 | #include <__algorithm/push_heap.h> |
Nikolas Klauser | d959d84 | 2022-04-15 13:43:40 +0200 | [diff] [blame] | 993 | #include <__algorithm/ranges_copy.h> |
| 994 | #include <__algorithm/ranges_copy_backward.h> |
| 995 | #include <__algorithm/ranges_copy_if.h> |
| 996 | #include <__algorithm/ranges_copy_n.h> |
Nikolas Klauser | f1373d0 | 2022-04-07 13:02:02 +0200 | [diff] [blame] | 997 | #include <__algorithm/ranges_count.h> |
| 998 | #include <__algorithm/ranges_count_if.h> |
Nikolas Klauser | 37d076e | 2022-03-12 01:45:35 +0100 | [diff] [blame] | 999 | #include <__algorithm/ranges_find.h> |
| 1000 | #include <__algorithm/ranges_find_if.h> |
| 1001 | #include <__algorithm/ranges_find_if_not.h> |
Nikolas Klauser | 58de98c | 2022-05-04 20:27:07 +0200 | [diff] [blame] | 1002 | #include <__algorithm/ranges_for_each.h> |
| 1003 | #include <__algorithm/ranges_for_each_n.h> |
Nikolas Klauser | bb9049d | 2022-05-04 14:19:09 +0200 | [diff] [blame] | 1004 | #include <__algorithm/ranges_is_partitioned.h> |
Nikolas Klauser | 573cd6f | 2022-04-03 09:17:01 +0200 | [diff] [blame] | 1005 | #include <__algorithm/ranges_max.h> |
Nikolas Klauser | f2a69ea | 2022-03-07 17:01:52 +0100 | [diff] [blame] | 1006 | #include <__algorithm/ranges_max_element.h> |
Nikolas Klauser | 3559e45 | 2022-03-18 02:57:08 +0100 | [diff] [blame] | 1007 | #include <__algorithm/ranges_min.h> |
Nikolas Klauser | 0a62a17 | 2022-02-11 13:11:57 +0100 | [diff] [blame] | 1008 | #include <__algorithm/ranges_min_element.h> |
Nikolas Klauser | 0a2f44f | 2022-04-13 22:59:09 +0200 | [diff] [blame] | 1009 | #include <__algorithm/ranges_minmax.h> |
| 1010 | #include <__algorithm/ranges_minmax_element.h> |
Nikolas Klauser | 12fc9bf | 2022-03-08 23:12:35 +0100 | [diff] [blame] | 1011 | #include <__algorithm/ranges_mismatch.h> |
Nikolas Klauser | 4ceab5f | 2022-02-10 13:33:03 +0100 | [diff] [blame] | 1012 | #include <__algorithm/ranges_swap_ranges.h> |
Nikolas Klauser | 559a177 | 2022-04-05 11:05:36 +0200 | [diff] [blame] | 1013 | #include <__algorithm/ranges_transform.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 1014 | #include <__algorithm/remove.h> |
| 1015 | #include <__algorithm/remove_copy.h> |
| 1016 | #include <__algorithm/remove_copy_if.h> |
| 1017 | #include <__algorithm/remove_if.h> |
| 1018 | #include <__algorithm/replace.h> |
| 1019 | #include <__algorithm/replace_copy.h> |
| 1020 | #include <__algorithm/replace_copy_if.h> |
| 1021 | #include <__algorithm/replace_if.h> |
| 1022 | #include <__algorithm/reverse.h> |
| 1023 | #include <__algorithm/reverse_copy.h> |
| 1024 | #include <__algorithm/rotate.h> |
| 1025 | #include <__algorithm/rotate_copy.h> |
| 1026 | #include <__algorithm/sample.h> |
| 1027 | #include <__algorithm/search.h> |
| 1028 | #include <__algorithm/search_n.h> |
| 1029 | #include <__algorithm/set_difference.h> |
| 1030 | #include <__algorithm/set_intersection.h> |
| 1031 | #include <__algorithm/set_symmetric_difference.h> |
| 1032 | #include <__algorithm/set_union.h> |
| 1033 | #include <__algorithm/shift_left.h> |
| 1034 | #include <__algorithm/shift_right.h> |
| 1035 | #include <__algorithm/shuffle.h> |
| 1036 | #include <__algorithm/sift_down.h> |
| 1037 | #include <__algorithm/sort.h> |
| 1038 | #include <__algorithm/sort_heap.h> |
| 1039 | #include <__algorithm/stable_partition.h> |
| 1040 | #include <__algorithm/stable_sort.h> |
Christopher Di Bella | 41f26e8 | 2021-06-05 02:47:47 +0000 | [diff] [blame] | 1041 | #include <__algorithm/swap_ranges.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 1042 | #include <__algorithm/transform.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 1043 | #include <__algorithm/unique.h> |
Arthur O'Dwyer | 65077c0 | 2022-01-07 09:45:05 -0500 | [diff] [blame] | 1044 | #include <__algorithm/unique_copy.h> |
Louis Dionne | a60dd87 | 2021-06-17 11:30:11 -0400 | [diff] [blame] | 1045 | #include <__algorithm/unwrap_iter.h> |
| 1046 | #include <__algorithm/upper_bound.h> |
Eric Fiselier | 14b6de9 | 2014-08-10 23:53:08 +0000 | [diff] [blame] | 1047 | |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 1048 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Arthur O'Dwyer | 6eeaa00 | 2022-02-01 20:16:40 -0500 | [diff] [blame] | 1049 | # pragma GCC system_header |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 1050 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1051 | |
Louis Dionne | 59d0b3c | 2019-08-05 18:29:14 +0000 | [diff] [blame] | 1052 | #if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17 |
Louis Dionne | d53d8c0 | 2019-08-06 21:11:24 +0000 | [diff] [blame] | 1053 | # include <__pstl_algorithm> |
Louis Dionne | 59d0b3c | 2019-08-05 18:29:14 +0000 | [diff] [blame] | 1054 | #endif |
| 1055 | |
Louis Dionne | 2b1ceaa | 2021-04-20 12:03:32 -0400 | [diff] [blame] | 1056 | #endif // _LIBCPP_ALGORITHM |