1 | // <algorithm> Forward declarations -*- C++ -*- |
2 | |
3 | // Copyright (C) 2007-2015 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 | template<typename _Tp> |
570 | void |
571 | swap(_Tp&, _Tp&) |
572 | #if __cplusplus >= 201103L |
573 | noexcept(__and_<is_nothrow_move_constructible<_Tp>, |
574 | is_nothrow_move_assignable<_Tp>>::value) |
575 | #endif |
576 | ; |
577 | |
578 | template<typename _Tp, size_t _Nm> |
579 | void |
580 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) |
581 | #if __cplusplus >= 201103L |
582 | noexcept(noexcept(swap(*__a, *__b))) |
583 | #endif |
584 | ; |
585 | |
586 | template<typename _FIter1, typename _FIter2> |
587 | _FIter2 |
588 | swap_ranges(_FIter1, _FIter1, _FIter2); |
589 | |
590 | // transform |
591 | |
592 | template<typename _FIter> |
593 | _FIter |
594 | unique(_FIter, _FIter); |
595 | |
596 | template<typename _FIter, typename _BinaryPredicate> |
597 | _FIter |
598 | unique(_FIter, _FIter, _BinaryPredicate); |
599 | |
600 | // unique_copy |
601 | |
602 | template<typename _FIter, typename _Tp> |
603 | _FIter |
604 | upper_bound(_FIter, _FIter, const _Tp&); |
605 | |
606 | template<typename _FIter, typename _Tp, typename _Compare> |
607 | _FIter |
608 | upper_bound(_FIter, _FIter, const _Tp&, _Compare); |
609 | |
610 | _GLIBCXX_END_NAMESPACE_VERSION |
611 | |
612 | _GLIBCXX_BEGIN_NAMESPACE_ALGO |
613 | |
614 | template<typename _FIter> |
615 | _FIter |
616 | adjacent_find(_FIter, _FIter); |
617 | |
618 | template<typename _FIter, typename _BinaryPredicate> |
619 | _FIter |
620 | adjacent_find(_FIter, _FIter, _BinaryPredicate); |
621 | |
622 | template<typename _IIter, typename _Tp> |
623 | typename iterator_traits<_IIter>::difference_type |
624 | count(_IIter, _IIter, const _Tp&); |
625 | |
626 | template<typename _IIter, typename _Predicate> |
627 | typename iterator_traits<_IIter>::difference_type |
628 | count_if(_IIter, _IIter, _Predicate); |
629 | |
630 | template<typename _IIter1, typename _IIter2> |
631 | bool |
632 | equal(_IIter1, _IIter1, _IIter2); |
633 | |
634 | template<typename _IIter1, typename _IIter2, typename _BinaryPredicate> |
635 | bool |
636 | equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate); |
637 | |
638 | template<typename _IIter, typename _Tp> |
639 | _IIter |
640 | find(_IIter, _IIter, const _Tp&); |
641 | |
642 | template<typename _FIter1, typename _FIter2> |
643 | _FIter1 |
644 | find_first_of(_FIter1, _FIter1, _FIter2, _FIter2); |
645 | |
646 | template<typename _FIter1, typename _FIter2, typename _BinaryPredicate> |
647 | _FIter1 |
648 | find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate); |
649 | |
650 | template<typename _IIter, typename _Predicate> |
651 | _IIter |
652 | find_if(_IIter, _IIter, _Predicate); |
653 | |
654 | template<typename _IIter, typename _Funct> |
655 | _Funct |
656 | for_each(_IIter, _IIter, _Funct); |
657 | |
658 | template<typename _FIter, typename _Generator> |
659 | void |
660 | generate(_FIter, _FIter, _Generator); |
661 | |
662 | template<typename _OIter, typename _Size, typename _Generator> |
663 | _OIter |
664 | generate_n(_OIter, _Size, _Generator); |
665 | |
666 | template<typename _IIter1, typename _IIter2> |
667 | bool |
668 | lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2); |
669 | |
670 | template<typename _IIter1, typename _IIter2, typename _Compare> |
671 | bool |
672 | lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare); |
673 | |
674 | template<typename _FIter> |
675 | _GLIBCXX14_CONSTEXPR |
676 | _FIter |
677 | max_element(_FIter, _FIter); |
678 | |
679 | template<typename _FIter, typename _Compare> |
680 | _GLIBCXX14_CONSTEXPR |
681 | _FIter |
682 | max_element(_FIter, _FIter, _Compare); |
683 | |
684 | template<typename _IIter1, typename _IIter2, typename _OIter> |
685 | _OIter |
686 | merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); |
687 | |
688 | template<typename _IIter1, typename _IIter2, typename _OIter, |
689 | typename _Compare> |
690 | _OIter |
691 | merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); |
692 | |
693 | template<typename _FIter> |
694 | _GLIBCXX14_CONSTEXPR |
695 | _FIter |
696 | min_element(_FIter, _FIter); |
697 | |
698 | template<typename _FIter, typename _Compare> |
699 | _GLIBCXX14_CONSTEXPR |
700 | _FIter |
701 | min_element(_FIter, _FIter, _Compare); |
702 | |
703 | template<typename _IIter1, typename _IIter2> |
704 | pair<_IIter1, _IIter2> |
705 | mismatch(_IIter1, _IIter1, _IIter2); |
706 | |
707 | template<typename _IIter1, typename _IIter2, typename _BinaryPredicate> |
708 | pair<_IIter1, _IIter2> |
709 | mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate); |
710 | |
711 | template<typename _RAIter> |
712 | void |
713 | nth_element(_RAIter, _RAIter, _RAIter); |
714 | |
715 | template<typename _RAIter, typename _Compare> |
716 | void |
717 | nth_element(_RAIter, _RAIter, _RAIter, _Compare); |
718 | |
719 | template<typename _RAIter> |
720 | void |
721 | partial_sort(_RAIter, _RAIter, _RAIter); |
722 | |
723 | template<typename _RAIter, typename _Compare> |
724 | void |
725 | partial_sort(_RAIter, _RAIter, _RAIter, _Compare); |
726 | |
727 | template<typename _BIter, typename _Predicate> |
728 | _BIter |
729 | partition(_BIter, _BIter, _Predicate); |
730 | |
731 | template<typename _RAIter> |
732 | void |
733 | random_shuffle(_RAIter, _RAIter); |
734 | |
735 | template<typename _RAIter, typename _Generator> |
736 | void |
737 | random_shuffle(_RAIter, _RAIter, |
738 | #if __cplusplus >= 201103L |
739 | _Generator&&); |
740 | #else |
741 | _Generator&); |
742 | #endif |
743 | |
744 | template<typename _FIter, typename _Tp> |
745 | void |
746 | replace(_FIter, _FIter, const _Tp&, const _Tp&); |
747 | |
748 | template<typename _FIter, typename _Predicate, typename _Tp> |
749 | void |
750 | replace_if(_FIter, _FIter, _Predicate, const _Tp&); |
751 | |
752 | template<typename _FIter1, typename _FIter2> |
753 | _FIter1 |
754 | search(_FIter1, _FIter1, _FIter2, _FIter2); |
755 | |
756 | template<typename _FIter1, typename _FIter2, typename _BinaryPredicate> |
757 | _FIter1 |
758 | search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate); |
759 | |
760 | template<typename _FIter, typename _Size, typename _Tp> |
761 | _FIter |
762 | search_n(_FIter, _FIter, _Size, const _Tp&); |
763 | |
764 | template<typename _FIter, typename _Size, typename _Tp, |
765 | typename _BinaryPredicate> |
766 | _FIter |
767 | search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate); |
768 | |
769 | template<typename _IIter1, typename _IIter2, typename _OIter> |
770 | _OIter |
771 | set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); |
772 | |
773 | template<typename _IIter1, typename _IIter2, typename _OIter, |
774 | typename _Compare> |
775 | _OIter |
776 | set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); |
777 | |
778 | template<typename _IIter1, typename _IIter2, typename _OIter> |
779 | _OIter |
780 | set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); |
781 | |
782 | template<typename _IIter1, typename _IIter2, typename _OIter, |
783 | typename _Compare> |
784 | _OIter |
785 | set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); |
786 | |
787 | template<typename _IIter1, typename _IIter2, typename _OIter> |
788 | _OIter |
789 | set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); |
790 | |
791 | template<typename _IIter1, typename _IIter2, typename _OIter, |
792 | typename _Compare> |
793 | _OIter |
794 | set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, |
795 | _OIter, _Compare); |
796 | |
797 | template<typename _IIter1, typename _IIter2, typename _OIter> |
798 | _OIter |
799 | set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); |
800 | |
801 | template<typename _IIter1, typename _IIter2, typename _OIter, |
802 | typename _Compare> |
803 | _OIter |
804 | set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); |
805 | |
806 | template<typename _RAIter> |
807 | void |
808 | sort(_RAIter, _RAIter); |
809 | |
810 | template<typename _RAIter, typename _Compare> |
811 | void |
812 | sort(_RAIter, _RAIter, _Compare); |
813 | |
814 | template<typename _RAIter> |
815 | void |
816 | stable_sort(_RAIter, _RAIter); |
817 | |
818 | template<typename _RAIter, typename _Compare> |
819 | void |
820 | stable_sort(_RAIter, _RAIter, _Compare); |
821 | |
822 | template<typename _IIter, typename _OIter, typename _UnaryOperation> |
823 | _OIter |
824 | transform(_IIter, _IIter, _OIter, _UnaryOperation); |
825 | |
826 | template<typename _IIter1, typename _IIter2, typename _OIter, |
827 | typename _BinaryOperation> |
828 | _OIter |
829 | transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation); |
830 | |
831 | template<typename _IIter, typename _OIter> |
832 | _OIter |
833 | unique_copy(_IIter, _IIter, _OIter); |
834 | |
835 | template<typename _IIter, typename _OIter, typename _BinaryPredicate> |
836 | _OIter |
837 | unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate); |
838 | |
839 | _GLIBCXX_END_NAMESPACE_ALGO |
840 | } // namespace std |
841 | |
842 | #ifdef _GLIBCXX_PARALLEL |
843 | # include <parallel/algorithmfwd.h> |
844 | #endif |
845 | |
846 | #endif |
847 | |
848 | |