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