]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/include/bits/algorithmfwd.h
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / bits / algorithmfwd.h
CommitLineData
cd1e6665 1// <algorithm> Forward declarations -*- C++ -*-
c2ba9709 2
a945c346 3// Copyright (C) 2007-2024 Free Software Foundation, Inc.
c2ba9709
JS
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
748086b7 8// Free Software Foundation; either version 3, or (at your option)
c2ba9709
JS
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
748086b7
JJ
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
c2ba9709
JS
24
25/** @file bits/algorithmfwd.h
26 * This is an internal header file, included by other library headers.
f910786b 27 * Do not attempt to use it directly. @headername{algorithm}
c2ba9709
JS
28 */
29
c2ba9709
JS
30#ifndef _GLIBCXX_ALGORITHMFWD_H
31#define _GLIBCXX_ALGORITHMFWD_H 1
32
33#pragma GCC system_header
34
35#include <bits/c++config.h>
36#include <bits/stl_pair.h>
37#include <bits/stl_iterator_base_types.h>
734f5023 38#if __cplusplus >= 201103L
1edd1a83 39#include <initializer_list>
a7d5d7e2 40#endif
c2ba9709 41
12ffa228
BK
42namespace std _GLIBCXX_VISIBILITY(default)
43{
44_GLIBCXX_BEGIN_NAMESPACE_VERSION
c2ba9709 45
aac2878e
BK
46 /*
47 adjacent_find
4f5f9962
JW
48 all_of (C++11)
49 any_of (C++11)
aac2878e 50 binary_search
4db1cb44 51 clamp (C++17)
aac2878e
BK
52 copy
53 copy_backward
4f5f9962
JW
54 copy_if (C++11)
55 copy_n (C++11)
aac2878e
BK
56 count
57 count_if
58 equal
59 equal_range
60 fill
61 fill_n
62 find
63 find_end
64 find_first_of
65 find_if
4f5f9962 66 find_if_not (C++11)
aac2878e
BK
67 for_each
68 generate
69 generate_n
70 includes
71 inplace_merge
4f5f9962
JW
72 is_heap (C++11)
73 is_heap_until (C++11)
74 is_partitioned (C++11)
75 is_sorted (C++11)
76 is_sorted_until (C++11)
aac2878e
BK
77 iter_swap
78 lexicographical_compare
79 lower_bound
80 make_heap
81 max
82 max_element
83 merge
84 min
85 min_element
4f5f9962
JW
86 minmax (C++11)
87 minmax_element (C++11)
aac2878e
BK
88 mismatch
89 next_permutation
4f5f9962 90 none_of (C++11)
aac2878e
BK
91 nth_element
92 partial_sort
93 partial_sort_copy
94 partition
4f5f9962
JW
95 partition_copy (C++11)
96 partition_point (C++11)
aac2878e
BK
97 pop_heap
98 prev_permutation
99 push_heap
100 random_shuffle
101 remove
102 remove_copy
103 remove_copy_if
104 remove_if
105 replace
106 replace_copy
107 replace_copy_if
108 replace_if
109 reverse
110 reverse_copy
111 rotate
112 rotate_copy
113 search
114 search_n
115 set_difference
116 set_intersection
117 set_symmetric_difference
118 set_union
4f5f9962 119 shuffle (C++11)
aac2878e
BK
120 sort
121 sort_heap
122 stable_partition
123 stable_sort
124 swap
125 swap_ranges
126 transform
127 unique
128 unique_copy
129 upper_bound
130 */
131
132 /**
133 * @defgroup algorithms Algorithms
134 *
135 * Components for performing algorithmic operations. Includes
136 * non-modifying sequence, modifying (mutating) sequence, sorting,
137 * searching, merge, partition, heap, set, minima, maxima, and
138 * permutation operations.
139 */
140
141 /**
5ab3a5af 142 * @defgroup mutating_algorithms Mutating
5b9daa7e
BK
143 * @ingroup algorithms
144 */
145
146 /**
5ab3a5af 147 * @defgroup non_mutating_algorithms Non-Mutating
5b9daa7e
BK
148 * @ingroup algorithms
149 */
150
151 /**
5ab3a5af 152 * @defgroup sorting_algorithms Sorting
aac2878e 153 * @ingroup algorithms
5b9daa7e
BK
154 */
155
156 /**
ed920373 157 * @defgroup set_algorithms Set Operations
5b9daa7e 158 * @ingroup sorting_algorithms
aac2878e
BK
159 *
160 * These algorithms are common set operations performed on sequences
161 * that are already sorted. The number of comparisons will be
162 * linear.
163 */
164
165 /**
5ab3a5af 166 * @defgroup binary_search_algorithms Binary Search
5b9daa7e 167 * @ingroup sorting_algorithms
aac2878e
BK
168 *
169 * These algorithms are variations of a classic binary search, and
170 * all assume that the sequence being searched is already sorted.
9a38acdf 171 *
aac2878e
BK
172 * The number of comparisons will be logarithmic (and as few as
173 * possible). The number of steps through the sequence will be
174 * logarithmic for random-access iterators (e.g., pointers), and
175 * linear otherwise.
9a38acdf 176 *
aac2878e
BK
177 * The LWG has passed Defect Report 270, which notes: <em>The
178 * proposed resolution reinterprets binary search. Instead of
179 * thinking about searching for a value in a sorted range, we view
180 * that as an important special case of a more general algorithm:
181 * searching for the partition point in a partitioned range. We
182 * also add a guarantee that the old wording did not: we ensure that
183 * the upper bound is no earlier than the lower bound, that the pair
184 * returned by equal_range is a valid range, and that the first part
185 * of that pair is the lower bound.</em>
186 *
187 * The actual effect of the first sentence is that a comparison
188 * functor passed by the user doesn't necessarily need to induce a
189 * strict weak ordering relation. Rather, it partitions the range.
190 */
191
c2ba9709
JS
192 // adjacent_find
193
734f5023 194#if __cplusplus >= 201103L
688a7a07 195 template<typename _IIter, typename _Predicate>
3a66e68a 196 _GLIBCXX20_CONSTEXPR
688a7a07
PC
197 bool
198 all_of(_IIter, _IIter, _Predicate);
199
200 template<typename _IIter, typename _Predicate>
3a66e68a 201 _GLIBCXX20_CONSTEXPR
688a7a07
PC
202 bool
203 any_of(_IIter, _IIter, _Predicate);
204#endif
205
c2ba9709 206 template<typename _FIter, typename _Tp>
3a66e68a 207 _GLIBCXX20_CONSTEXPR
9a38acdf 208 bool
c2ba9709
JS
209 binary_search(_FIter, _FIter, const _Tp&);
210
211 template<typename _FIter, typename _Tp, typename _Compare>
3a66e68a 212 _GLIBCXX20_CONSTEXPR
9a38acdf 213 bool
c2ba9709
JS
214 binary_search(_FIter, _FIter, const _Tp&, _Compare);
215
4db1cb44
ESR
216#if __cplusplus > 201402L
217 template<typename _Tp>
218 _GLIBCXX14_CONSTEXPR
219 const _Tp&
220 clamp(const _Tp&, const _Tp&, const _Tp&);
221
222 template<typename _Tp, typename _Compare>
223 _GLIBCXX14_CONSTEXPR
224 const _Tp&
225 clamp(const _Tp&, const _Tp&, const _Tp&, _Compare);
226#endif
227
c2ba9709 228 template<typename _IIter, typename _OIter>
3a66e68a 229 _GLIBCXX20_CONSTEXPR
9a38acdf 230 _OIter
c2ba9709
JS
231 copy(_IIter, _IIter, _OIter);
232
233 template<typename _BIter1, typename _BIter2>
3a66e68a 234 _GLIBCXX20_CONSTEXPR
c2ba9709 235 _BIter2
4f99f3d0 236 copy_backward(_BIter1, _BIter1, _BIter2);
c2ba9709 237
734f5023 238#if __cplusplus >= 201103L
688a7a07 239 template<typename _IIter, typename _OIter, typename _Predicate>
3a66e68a 240 _GLIBCXX20_CONSTEXPR
688a7a07
PC
241 _OIter
242 copy_if(_IIter, _IIter, _OIter, _Predicate);
b0371776
PC
243
244 template<typename _IIter, typename _Size, typename _OIter>
3a66e68a 245 _GLIBCXX20_CONSTEXPR
b0371776
PC
246 _OIter
247 copy_n(_IIter, _Size, _OIter);
688a7a07
PC
248#endif
249
c2ba9709
JS
250 // count
251 // count_if
252
253 template<typename _FIter, typename _Tp>
3a66e68a 254 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
255 pair<_FIter, _FIter>
256 equal_range(_FIter, _FIter, const _Tp&);
257
258 template<typename _FIter, typename _Tp, typename _Compare>
3a66e68a 259 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
260 pair<_FIter, _FIter>
261 equal_range(_FIter, _FIter, const _Tp&, _Compare);
262
263 template<typename _FIter, typename _Tp>
3a66e68a 264 _GLIBCXX20_CONSTEXPR
9a38acdf 265 void
c2ba9709
JS
266 fill(_FIter, _FIter, const _Tp&);
267
c2ba9709 268 template<typename _OIter, typename _Size, typename _Tp>
3a66e68a 269 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
270 _OIter
271 fill_n(_OIter, _Size, const _Tp&);
272
273 // find
6f95a65a
BK
274
275 template<typename _FIter1, typename _FIter2>
3a66e68a 276 _GLIBCXX20_CONSTEXPR
6f95a65a
BK
277 _FIter1
278 find_end(_FIter1, _FIter1, _FIter2, _FIter2);
279
280 template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
3a66e68a 281 _GLIBCXX20_CONSTEXPR
6f95a65a
BK
282 _FIter1
283 find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
284
c2ba9709
JS
285 // find_first_of
286 // find_if
c2ba9709 287
734f5023 288#if __cplusplus >= 201103L
76cc1b70 289 template<typename _IIter, typename _Predicate>
3a66e68a 290 _GLIBCXX20_CONSTEXPR
76cc1b70
PC
291 _IIter
292 find_if_not(_IIter, _IIter, _Predicate);
293#endif
294
688a7a07
PC
295 // for_each
296 // generate
297 // generate_n
298
c2ba9709 299 template<typename _IIter1, typename _IIter2>
3a66e68a 300 _GLIBCXX20_CONSTEXPR
9a38acdf 301 bool
c2ba9709
JS
302 includes(_IIter1, _IIter1, _IIter2, _IIter2);
303
304 template<typename _IIter1, typename _IIter2, typename _Compare>
3a66e68a 305 _GLIBCXX20_CONSTEXPR
9a38acdf 306 bool
c2ba9709
JS
307 includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
308
309 template<typename _BIter>
9a38acdf 310 void
c2ba9709
JS
311 inplace_merge(_BIter, _BIter, _BIter);
312
313 template<typename _BIter, typename _Compare>
9a38acdf 314 void
c2ba9709
JS
315 inplace_merge(_BIter, _BIter, _BIter, _Compare);
316
734f5023 317#if __cplusplus >= 201103L
e69f1bad 318 template<typename _RAIter>
3a66e68a 319 _GLIBCXX20_CONSTEXPR
9a38acdf 320 bool
e69f1bad
PC
321 is_heap(_RAIter, _RAIter);
322
323 template<typename _RAIter, typename _Compare>
3a66e68a 324 _GLIBCXX20_CONSTEXPR
9a38acdf 325 bool
e69f1bad
PC
326 is_heap(_RAIter, _RAIter, _Compare);
327
328 template<typename _RAIter>
3a66e68a 329 _GLIBCXX20_CONSTEXPR
9a38acdf 330 _RAIter
e69f1bad
PC
331 is_heap_until(_RAIter, _RAIter);
332
333 template<typename _RAIter, typename _Compare>
3a66e68a 334 _GLIBCXX20_CONSTEXPR
9a38acdf 335 _RAIter
e69f1bad 336 is_heap_until(_RAIter, _RAIter, _Compare);
4b7ed13a 337
04dbd891 338 template<typename _IIter, typename _Predicate>
3a66e68a 339 _GLIBCXX20_CONSTEXPR
04dbd891
PC
340 bool
341 is_partitioned(_IIter, _IIter, _Predicate);
342
632469d0 343 template<typename _FIter1, typename _FIter2>
3a66e68a 344 _GLIBCXX20_CONSTEXPR
632469d0
PC
345 bool
346 is_permutation(_FIter1, _FIter1, _FIter2);
347
348 template<typename _FIter1, typename _FIter2,
349 typename _BinaryPredicate>
3a66e68a 350 _GLIBCXX20_CONSTEXPR
632469d0
PC
351 bool
352 is_permutation(_FIter1, _FIter1, _FIter2, _BinaryPredicate);
353
4b7ed13a 354 template<typename _FIter>
3a66e68a 355 _GLIBCXX20_CONSTEXPR
9a38acdf 356 bool
4b7ed13a
PC
357 is_sorted(_FIter, _FIter);
358
359 template<typename _FIter, typename _Compare>
3a66e68a 360 _GLIBCXX20_CONSTEXPR
9a38acdf 361 bool
4b7ed13a
PC
362 is_sorted(_FIter, _FIter, _Compare);
363
364 template<typename _FIter>
3a66e68a 365 _GLIBCXX20_CONSTEXPR
9a38acdf 366 _FIter
4b7ed13a
PC
367 is_sorted_until(_FIter, _FIter);
368
369 template<typename _FIter, typename _Compare>
3a66e68a 370 _GLIBCXX20_CONSTEXPR
9a38acdf 371 _FIter
4b7ed13a 372 is_sorted_until(_FIter, _FIter, _Compare);
e69f1bad
PC
373#endif
374
c2ba9709 375 template<typename _FIter1, typename _FIter2>
7a91c710 376 _GLIBCXX20_CONSTEXPR
9a38acdf 377 void
c2ba9709
JS
378 iter_swap(_FIter1, _FIter2);
379
c2ba9709 380 template<typename _FIter, typename _Tp>
3a66e68a 381 _GLIBCXX20_CONSTEXPR
9a38acdf 382 _FIter
c2ba9709
JS
383 lower_bound(_FIter, _FIter, const _Tp&);
384
385 template<typename _FIter, typename _Tp, typename _Compare>
3a66e68a 386 _GLIBCXX20_CONSTEXPR
9a38acdf 387 _FIter
c2ba9709
JS
388 lower_bound(_FIter, _FIter, const _Tp&, _Compare);
389
390 template<typename _RAIter>
7a91c710 391 _GLIBCXX20_CONSTEXPR
9a38acdf 392 void
c2ba9709
JS
393 make_heap(_RAIter, _RAIter);
394
395 template<typename _RAIter, typename _Compare>
7a91c710 396 _GLIBCXX20_CONSTEXPR
9a38acdf 397 void
c2ba9709
JS
398 make_heap(_RAIter, _RAIter, _Compare);
399
9a38acdf 400 template<typename _Tp>
8dff34fe 401 _GLIBCXX14_CONSTEXPR
9a38acdf 402 const _Tp&
c2ba9709
JS
403 max(const _Tp&, const _Tp&);
404
405 template<typename _Tp, typename _Compare>
8dff34fe 406 _GLIBCXX14_CONSTEXPR
9a38acdf 407 const _Tp&
c2ba9709
JS
408 max(const _Tp&, const _Tp&, _Compare);
409
410 // max_element
411 // merge
412
9a38acdf 413 template<typename _Tp>
8dff34fe 414 _GLIBCXX14_CONSTEXPR
9a38acdf 415 const _Tp&
c2ba9709
JS
416 min(const _Tp&, const _Tp&);
417
418 template<typename _Tp, typename _Compare>
8dff34fe 419 _GLIBCXX14_CONSTEXPR
9a38acdf 420 const _Tp&
c2ba9709
JS
421 min(const _Tp&, const _Tp&, _Compare);
422
423 // min_element
f6547b68 424
734f5023 425#if __cplusplus >= 201103L
f6547b68 426 template<typename _Tp>
8dff34fe 427 _GLIBCXX14_CONSTEXPR
9a38acdf 428 pair<const _Tp&, const _Tp&>
f6547b68
PC
429 minmax(const _Tp&, const _Tp&);
430
431 template<typename _Tp, typename _Compare>
8dff34fe 432 _GLIBCXX14_CONSTEXPR
f6547b68
PC
433 pair<const _Tp&, const _Tp&>
434 minmax(const _Tp&, const _Tp&, _Compare);
435
436 template<typename _FIter>
8dff34fe 437 _GLIBCXX14_CONSTEXPR
f6547b68
PC
438 pair<_FIter, _FIter>
439 minmax_element(_FIter, _FIter);
440
441 template<typename _FIter, typename _Compare>
8dff34fe 442 _GLIBCXX14_CONSTEXPR
f6547b68
PC
443 pair<_FIter, _FIter>
444 minmax_element(_FIter, _FIter, _Compare);
1edd1a83
PC
445
446 template<typename _Tp>
8dff34fe 447 _GLIBCXX14_CONSTEXPR
116a365b 448 _Tp
1edd1a83
PC
449 min(initializer_list<_Tp>);
450
451 template<typename _Tp, typename _Compare>
8dff34fe 452 _GLIBCXX14_CONSTEXPR
116a365b 453 _Tp
1edd1a83
PC
454 min(initializer_list<_Tp>, _Compare);
455
456 template<typename _Tp>
8dff34fe 457 _GLIBCXX14_CONSTEXPR
116a365b 458 _Tp
1edd1a83
PC
459 max(initializer_list<_Tp>);
460
461 template<typename _Tp, typename _Compare>
8dff34fe 462 _GLIBCXX14_CONSTEXPR
116a365b 463 _Tp
1edd1a83
PC
464 max(initializer_list<_Tp>, _Compare);
465
466 template<typename _Tp>
8dff34fe 467 _GLIBCXX14_CONSTEXPR
116a365b 468 pair<_Tp, _Tp>
1edd1a83
PC
469 minmax(initializer_list<_Tp>);
470
471 template<typename _Tp, typename _Compare>
8dff34fe 472 _GLIBCXX14_CONSTEXPR
116a365b 473 pair<_Tp, _Tp>
1edd1a83 474 minmax(initializer_list<_Tp>, _Compare);
f6547b68
PC
475#endif
476
c2ba9709
JS
477 // mismatch
478
479 template<typename _BIter>
7a91c710 480 _GLIBCXX20_CONSTEXPR
9a38acdf 481 bool
c2ba9709
JS
482 next_permutation(_BIter, _BIter);
483
484 template<typename _BIter, typename _Compare>
7a91c710 485 _GLIBCXX20_CONSTEXPR
9a38acdf 486 bool
c2ba9709
JS
487 next_permutation(_BIter, _BIter, _Compare);
488
734f5023 489#if __cplusplus >= 201103L
688a7a07 490 template<typename _IIter, typename _Predicate>
3a66e68a 491 _GLIBCXX20_CONSTEXPR
688a7a07
PC
492 bool
493 none_of(_IIter, _IIter, _Predicate);
494#endif
495
c2ba9709
JS
496 // nth_element
497 // partial_sort
498
499 template<typename _IIter, typename _RAIter>
7a91c710 500 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
501 _RAIter
502 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
503
504 template<typename _IIter, typename _RAIter, typename _Compare>
7a91c710 505 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
506 _RAIter
507 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
508
688a7a07
PC
509 // partition
510
734f5023 511#if __cplusplus >= 201103L
688a7a07
PC
512 template<typename _IIter, typename _OIter1,
513 typename _OIter2, typename _Predicate>
3a66e68a 514 _GLIBCXX20_CONSTEXPR
688a7a07
PC
515 pair<_OIter1, _OIter2>
516 partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate);
d9be9bb3
PC
517
518 template<typename _FIter, typename _Predicate>
3a66e68a 519 _GLIBCXX20_CONSTEXPR
d9be9bb3
PC
520 _FIter
521 partition_point(_FIter, _FIter, _Predicate);
688a7a07
PC
522#endif
523
c2ba9709 524 template<typename _RAIter>
7a91c710 525 _GLIBCXX20_CONSTEXPR
9a38acdf 526 void
c2ba9709
JS
527 pop_heap(_RAIter, _RAIter);
528
529 template<typename _RAIter, typename _Compare>
7a91c710 530 _GLIBCXX20_CONSTEXPR
9a38acdf 531 void
c2ba9709
JS
532 pop_heap(_RAIter, _RAIter, _Compare);
533
534 template<typename _BIter>
7a91c710 535 _GLIBCXX20_CONSTEXPR
9a38acdf 536 bool
c2ba9709
JS
537 prev_permutation(_BIter, _BIter);
538
539 template<typename _BIter, typename _Compare>
7a91c710 540 _GLIBCXX20_CONSTEXPR
9a38acdf 541 bool
c2ba9709
JS
542 prev_permutation(_BIter, _BIter, _Compare);
543
544 template<typename _RAIter>
7a91c710 545 _GLIBCXX20_CONSTEXPR
9a38acdf 546 void
c2ba9709
JS
547 push_heap(_RAIter, _RAIter);
548
549 template<typename _RAIter, typename _Compare>
7a91c710 550 _GLIBCXX20_CONSTEXPR
9a38acdf 551 void
c2ba9709
JS
552 push_heap(_RAIter, _RAIter, _Compare);
553
554 // random_shuffle
555
556 template<typename _FIter, typename _Tp>
3a66e68a 557 _GLIBCXX20_CONSTEXPR
9a38acdf 558 _FIter
c2ba9709
JS
559 remove(_FIter, _FIter, const _Tp&);
560
561 template<typename _FIter, typename _Predicate>
3a66e68a 562 _GLIBCXX20_CONSTEXPR
9a38acdf 563 _FIter
c2ba9709
JS
564 remove_if(_FIter, _FIter, _Predicate);
565
566 template<typename _IIter, typename _OIter, typename _Tp>
3a66e68a 567 _GLIBCXX20_CONSTEXPR
9a38acdf 568 _OIter
c2ba9709
JS
569 remove_copy(_IIter, _IIter, _OIter, const _Tp&);
570
571 template<typename _IIter, typename _OIter, typename _Predicate>
3a66e68a 572 _GLIBCXX20_CONSTEXPR
9a38acdf 573 _OIter
c2ba9709
JS
574 remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
575
576 // replace
577
578 template<typename _IIter, typename _OIter, typename _Tp>
3a66e68a 579 _GLIBCXX20_CONSTEXPR
9a38acdf 580 _OIter
c2ba9709
JS
581 replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&);
582
583 template<typename _Iter, typename _OIter, typename _Predicate, typename _Tp>
3a66e68a 584 _GLIBCXX20_CONSTEXPR
9a38acdf 585 _OIter
c2ba9709
JS
586 replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&);
587
588 // replace_if
589
590 template<typename _BIter>
7a91c710 591 _GLIBCXX20_CONSTEXPR
9a38acdf 592 void
c2ba9709
JS
593 reverse(_BIter, _BIter);
594
595 template<typename _BIter, typename _OIter>
3a66e68a 596 _GLIBCXX20_CONSTEXPR
9a38acdf 597 _OIter
c2ba9709
JS
598 reverse_copy(_BIter, _BIter, _OIter);
599
e4905f11
JW
600_GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
601
602 template<typename _FIter>
603 _GLIBCXX20_CONSTEXPR
604 _FIter
605 rotate(_FIter, _FIter, _FIter);
606
607_GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
c2ba9709
JS
608
609 template<typename _FIter, typename _OIter>
3a66e68a 610 _GLIBCXX20_CONSTEXPR
9a38acdf 611 _OIter
4f99f3d0 612 rotate_copy(_FIter, _FIter, _FIter, _OIter);
c2ba9709
JS
613
614 // search
615 // search_n
616 // set_difference
617 // set_intersection
618 // set_symmetric_difference
619 // set_union
620
6d664515 621#if __cplusplus >= 201103L
247d8075
PC
622 template<typename _RAIter, typename _UGenerator>
623 void
633e8e19 624 shuffle(_RAIter, _RAIter, _UGenerator&&);
247d8075
PC
625#endif
626
c2ba9709 627 template<typename _RAIter>
7a91c710 628 _GLIBCXX20_CONSTEXPR
9a38acdf 629 void
c2ba9709
JS
630 sort_heap(_RAIter, _RAIter);
631
632 template<typename _RAIter, typename _Compare>
7a91c710 633 _GLIBCXX20_CONSTEXPR
9a38acdf 634 void
c2ba9709
JS
635 sort_heap(_RAIter, _RAIter, _Compare);
636
18f176d0 637#if _GLIBCXX_HOSTED
c2ba9709 638 template<typename _BIter, typename _Predicate>
9a38acdf 639 _BIter
c2ba9709 640 stable_partition(_BIter, _BIter, _Predicate);
18f176d0 641#endif
c2ba9709 642
ddb63209
VV
643#if __cplusplus < 201103L
644 // For C++11 swap() is declared in <type_traits>.
c2ba9709 645
caa8b3c6 646 template<typename _Tp, size_t _Nm>
7a91c710 647 _GLIBCXX20_CONSTEXPR
ddb63209
VV
648 inline void
649 swap(_Tp& __a, _Tp& __b);
650
651 template<typename _Tp, size_t _Nm>
7a91c710 652 _GLIBCXX20_CONSTEXPR
ddb63209
VV
653 inline void
654 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]);
ccb4f5a7 655#endif
caa8b3c6 656
c2ba9709 657 template<typename _FIter1, typename _FIter2>
7a91c710 658 _GLIBCXX20_CONSTEXPR
9a38acdf 659 _FIter2
4f99f3d0 660 swap_ranges(_FIter1, _FIter1, _FIter2);
c2ba9709
JS
661
662 // transform
663
664 template<typename _FIter>
3a66e68a 665 _GLIBCXX20_CONSTEXPR
9a38acdf 666 _FIter
c2ba9709
JS
667 unique(_FIter, _FIter);
668
669 template<typename _FIter, typename _BinaryPredicate>
3a66e68a 670 _GLIBCXX20_CONSTEXPR
9a38acdf 671 _FIter
c2ba9709
JS
672 unique(_FIter, _FIter, _BinaryPredicate);
673
674 // unique_copy
675
676 template<typename _FIter, typename _Tp>
3a66e68a 677 _GLIBCXX20_CONSTEXPR
9a38acdf 678 _FIter
c2ba9709
JS
679 upper_bound(_FIter, _FIter, const _Tp&);
680
681 template<typename _FIter, typename _Tp, typename _Compare>
3a66e68a 682 _GLIBCXX20_CONSTEXPR
9a38acdf 683 _FIter
c2ba9709
JS
684 upper_bound(_FIter, _FIter, const _Tp&, _Compare);
685
12ffa228 686_GLIBCXX_BEGIN_NAMESPACE_ALGO
c2ba9709
JS
687
688 template<typename _FIter>
3a66e68a 689 _GLIBCXX20_CONSTEXPR
9a38acdf 690 _FIter
c2ba9709
JS
691 adjacent_find(_FIter, _FIter);
692
693 template<typename _FIter, typename _BinaryPredicate>
3a66e68a 694 _GLIBCXX20_CONSTEXPR
9a38acdf 695 _FIter
c2ba9709
JS
696 adjacent_find(_FIter, _FIter, _BinaryPredicate);
697
698 template<typename _IIter, typename _Tp>
3a66e68a 699 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
700 typename iterator_traits<_IIter>::difference_type
701 count(_IIter, _IIter, const _Tp&);
702
703 template<typename _IIter, typename _Predicate>
3a66e68a 704 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
705 typename iterator_traits<_IIter>::difference_type
706 count_if(_IIter, _IIter, _Predicate);
707
708 template<typename _IIter1, typename _IIter2>
3a66e68a 709 _GLIBCXX20_CONSTEXPR
9a38acdf 710 bool
c2ba9709
JS
711 equal(_IIter1, _IIter1, _IIter2);
712
713 template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
3a66e68a 714 _GLIBCXX20_CONSTEXPR
9a38acdf 715 bool
c2ba9709
JS
716 equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
717
718 template<typename _IIter, typename _Tp>
3a66e68a 719 _GLIBCXX20_CONSTEXPR
9a38acdf 720 _IIter
c2ba9709
JS
721 find(_IIter, _IIter, const _Tp&);
722
c2ba9709 723 template<typename _FIter1, typename _FIter2>
3a66e68a 724 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
725 _FIter1
726 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
727
728 template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
3a66e68a 729 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
730 _FIter1
731 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
732
733 template<typename _IIter, typename _Predicate>
3a66e68a 734 _GLIBCXX20_CONSTEXPR
76cc1b70 735 _IIter
c2ba9709
JS
736 find_if(_IIter, _IIter, _Predicate);
737
738 template<typename _IIter, typename _Funct>
3a66e68a 739 _GLIBCXX20_CONSTEXPR
9a38acdf 740 _Funct
c2ba9709
JS
741 for_each(_IIter, _IIter, _Funct);
742
743 template<typename _FIter, typename _Generator>
3a66e68a 744 _GLIBCXX20_CONSTEXPR
9a38acdf 745 void
c2ba9709
JS
746 generate(_FIter, _FIter, _Generator);
747
748 template<typename _OIter, typename _Size, typename _Generator>
3a66e68a 749 _GLIBCXX20_CONSTEXPR
4f99f3d0 750 _OIter
c2ba9709
JS
751 generate_n(_OIter, _Size, _Generator);
752
753 template<typename _IIter1, typename _IIter2>
3a66e68a 754 _GLIBCXX20_CONSTEXPR
9a38acdf 755 bool
c2ba9709
JS
756 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
757
758 template<typename _IIter1, typename _IIter2, typename _Compare>
3a66e68a 759 _GLIBCXX20_CONSTEXPR
9a38acdf 760 bool
c2ba9709
JS
761 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
762
763 template<typename _FIter>
8dff34fe 764 _GLIBCXX14_CONSTEXPR
9a38acdf 765 _FIter
c2ba9709
JS
766 max_element(_FIter, _FIter);
767
768 template<typename _FIter, typename _Compare>
8dff34fe 769 _GLIBCXX14_CONSTEXPR
9a38acdf 770 _FIter
c2ba9709
JS
771 max_element(_FIter, _FIter, _Compare);
772
773 template<typename _IIter1, typename _IIter2, typename _OIter>
3a66e68a 774 _GLIBCXX20_CONSTEXPR
9a38acdf 775 _OIter
c2ba9709
JS
776 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
777
9a38acdf 778 template<typename _IIter1, typename _IIter2, typename _OIter,
c2ba9709 779 typename _Compare>
3a66e68a 780 _GLIBCXX20_CONSTEXPR
9a38acdf 781 _OIter
c2ba9709
JS
782 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
783
784 template<typename _FIter>
8dff34fe 785 _GLIBCXX14_CONSTEXPR
9a38acdf 786 _FIter
c2ba9709
JS
787 min_element(_FIter, _FIter);
788
789 template<typename _FIter, typename _Compare>
8dff34fe 790 _GLIBCXX14_CONSTEXPR
9a38acdf 791 _FIter
c2ba9709
JS
792 min_element(_FIter, _FIter, _Compare);
793
794 template<typename _IIter1, typename _IIter2>
3a66e68a 795 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
796 pair<_IIter1, _IIter2>
797 mismatch(_IIter1, _IIter1, _IIter2);
798
799 template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
3a66e68a 800 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
801 pair<_IIter1, _IIter2>
802 mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
803
804 template<typename _RAIter>
7a91c710 805 _GLIBCXX20_CONSTEXPR
9a38acdf 806 void
c2ba9709
JS
807 nth_element(_RAIter, _RAIter, _RAIter);
808
809 template<typename _RAIter, typename _Compare>
7a91c710 810 _GLIBCXX20_CONSTEXPR
9a38acdf 811 void
c2ba9709
JS
812 nth_element(_RAIter, _RAIter, _RAIter, _Compare);
813
814 template<typename _RAIter>
7a91c710 815 _GLIBCXX20_CONSTEXPR
9a38acdf 816 void
c2ba9709
JS
817 partial_sort(_RAIter, _RAIter, _RAIter);
818
819 template<typename _RAIter, typename _Compare>
7a91c710 820 _GLIBCXX20_CONSTEXPR
9a38acdf 821 void
c2ba9709
JS
822 partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
823
824 template<typename _BIter, typename _Predicate>
7a91c710 825 _GLIBCXX20_CONSTEXPR
9a38acdf 826 _BIter
c2ba9709
JS
827 partition(_BIter, _BIter, _Predicate);
828
18f176d0 829#if _GLIBCXX_HOSTED
c2ba9709 830 template<typename _RAIter>
c01b344e 831 _GLIBCXX14_DEPRECATED_SUGGEST("std::shuffle")
9a38acdf 832 void
c2ba9709
JS
833 random_shuffle(_RAIter, _RAIter);
834
835 template<typename _RAIter, typename _Generator>
c01b344e 836 _GLIBCXX14_DEPRECATED_SUGGEST("std::shuffle")
9a38acdf 837 void
247d8075 838 random_shuffle(_RAIter, _RAIter,
734f5023 839#if __cplusplus >= 201103L
247d8075
PC
840 _Generator&&);
841#else
842 _Generator&);
843#endif
18f176d0 844#endif // HOSTED
c2ba9709
JS
845
846 template<typename _FIter, typename _Tp>
3a66e68a 847 _GLIBCXX20_CONSTEXPR
9a38acdf 848 void
c2ba9709
JS
849 replace(_FIter, _FIter, const _Tp&, const _Tp&);
850
851 template<typename _FIter, typename _Predicate, typename _Tp>
3a66e68a 852 _GLIBCXX20_CONSTEXPR
9a38acdf 853 void
c2ba9709
JS
854 replace_if(_FIter, _FIter, _Predicate, const _Tp&);
855
856 template<typename _FIter1, typename _FIter2>
3a66e68a 857 _GLIBCXX20_CONSTEXPR
9a38acdf 858 _FIter1
c2ba9709
JS
859 search(_FIter1, _FIter1, _FIter2, _FIter2);
860
861 template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
3a66e68a 862 _GLIBCXX20_CONSTEXPR
9a38acdf 863 _FIter1
c2ba9709
JS
864 search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
865
866 template<typename _FIter, typename _Size, typename _Tp>
3a66e68a 867 _GLIBCXX20_CONSTEXPR
9a38acdf 868 _FIter
c2ba9709
JS
869 search_n(_FIter, _FIter, _Size, const _Tp&);
870
9a38acdf 871 template<typename _FIter, typename _Size, typename _Tp,
c2ba9709 872 typename _BinaryPredicate>
3a66e68a 873 _GLIBCXX20_CONSTEXPR
9a38acdf 874 _FIter
c2ba9709
JS
875 search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate);
876
877 template<typename _IIter1, typename _IIter2, typename _OIter>
3a66e68a 878 _GLIBCXX20_CONSTEXPR
9a38acdf 879 _OIter
c2ba9709
JS
880 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
881
9a38acdf 882 template<typename _IIter1, typename _IIter2, typename _OIter,
c2ba9709 883 typename _Compare>
3a66e68a 884 _GLIBCXX20_CONSTEXPR
9a38acdf 885 _OIter
c2ba9709
JS
886 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
887
888 template<typename _IIter1, typename _IIter2, typename _OIter>
3a66e68a 889 _GLIBCXX20_CONSTEXPR
9a38acdf 890 _OIter
c2ba9709
JS
891 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
892
893 template<typename _IIter1, typename _IIter2, typename _OIter,
894 typename _Compare>
3a66e68a 895 _GLIBCXX20_CONSTEXPR
9a38acdf 896 _OIter
c2ba9709
JS
897 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
898
899 template<typename _IIter1, typename _IIter2, typename _OIter>
3a66e68a 900 _GLIBCXX20_CONSTEXPR
c2ba9709
JS
901 _OIter
902 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
903
9a38acdf 904 template<typename _IIter1, typename _IIter2, typename _OIter,
c2ba9709 905 typename _Compare>
3a66e68a 906 _GLIBCXX20_CONSTEXPR
c2ba9709 907 _OIter
9a38acdf 908 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
c2ba9709
JS
909 _OIter, _Compare);
910
911 template<typename _IIter1, typename _IIter2, typename _OIter>
3a66e68a 912 _GLIBCXX20_CONSTEXPR
9a38acdf 913 _OIter
c2ba9709
JS
914 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
915
916 template<typename _IIter1, typename _IIter2, typename _OIter,
917 typename _Compare>
3a66e68a 918 _GLIBCXX20_CONSTEXPR
9a38acdf 919 _OIter
c2ba9709
JS
920 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
921
922 template<typename _RAIter>
7a91c710 923 _GLIBCXX20_CONSTEXPR
9a38acdf 924 void
c2ba9709
JS
925 sort(_RAIter, _RAIter);
926
927 template<typename _RAIter, typename _Compare>
7a91c710 928 _GLIBCXX20_CONSTEXPR
9a38acdf 929 void
c2ba9709
JS
930 sort(_RAIter, _RAIter, _Compare);
931
932 template<typename _RAIter>
9a38acdf 933 void
c2ba9709
JS
934 stable_sort(_RAIter, _RAIter);
935
936 template<typename _RAIter, typename _Compare>
9a38acdf 937 void
c2ba9709
JS
938 stable_sort(_RAIter, _RAIter, _Compare);
939
940 template<typename _IIter, typename _OIter, typename _UnaryOperation>
3a66e68a 941 _GLIBCXX20_CONSTEXPR
9a38acdf 942 _OIter
c2ba9709
JS
943 transform(_IIter, _IIter, _OIter, _UnaryOperation);
944
9a38acdf 945 template<typename _IIter1, typename _IIter2, typename _OIter,
c2ba9709 946 typename _BinaryOperation>
3a66e68a 947 _GLIBCXX20_CONSTEXPR
9a38acdf 948 _OIter
c2ba9709
JS
949 transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
950
951 template<typename _IIter, typename _OIter>
3a66e68a 952 _GLIBCXX20_CONSTEXPR
9a38acdf 953 _OIter
c2ba9709
JS
954 unique_copy(_IIter, _IIter, _OIter);
955
956 template<typename _IIter, typename _OIter, typename _BinaryPredicate>
3a66e68a 957 _GLIBCXX20_CONSTEXPR
9a38acdf 958 _OIter
c2ba9709
JS
959 unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
960
12ffa228 961_GLIBCXX_END_NAMESPACE_ALGO
4a15d842 962_GLIBCXX_END_NAMESPACE_VERSION
12ffa228 963} // namespace std
c2ba9709 964
7c3e9502 965#ifdef _GLIBCXX_PARALLEL
c2ba9709
JS
966# include <parallel/algorithmfwd.h>
967#endif
968
969#endif
970