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