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