30 #ifndef _GLIBCXX_ALGORITHMFWD_H
31 #define _GLIBCXX_ALGORITHMFWD_H 1
33 #pragma GCC system_header
40 namespace std _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
191 #ifdef __GXX_EXPERIMENTAL_CXX0X__
192 template<
typename _IIter,
typename _Predicate>
194 all_of(_IIter, _IIter, _Predicate);
196 template<
typename _IIter,
typename _Predicate>
198 any_of(_IIter, _IIter, _Predicate);
201 template<
typename _FIter,
typename _Tp>
203 binary_search(_FIter, _FIter,
const _Tp&);
205 template<
typename _FIter,
typename _Tp,
typename _Compare>
207 binary_search(_FIter, _FIter,
const _Tp&, _Compare);
209 template<
typename _IIter,
typename _OIter>
211 copy(_IIter, _IIter, _OIter);
213 template<
typename _BIter1,
typename _BIter2>
215 copy_backward(_BIter1, _BIter1, _BIter2);
217 #ifdef __GXX_EXPERIMENTAL_CXX0X__
218 template<
typename _IIter,
typename _OIter,
typename _Predicate>
220 copy_if(_IIter, _IIter, _OIter, _Predicate);
222 template<
typename _IIter,
typename _Size,
typename _OIter>
224 copy_n(_IIter, _Size, _OIter);
230 template<
typename _FIter,
typename _Tp>
232 equal_range(_FIter, _FIter,
const _Tp&);
234 template<
typename _FIter,
typename _Tp,
typename _Compare>
236 equal_range(_FIter, _FIter,
const _Tp&, _Compare);
238 template<
typename _FIter,
typename _Tp>
240 fill(_FIter, _FIter,
const _Tp&);
242 template<
typename _OIter,
typename _Size,
typename _Tp>
244 fill_n(_OIter, _Size,
const _Tp&);
248 template<
typename _FIter1,
typename _FIter2>
250 find_end(_FIter1, _FIter1, _FIter2, _FIter2);
252 template<
typename _FIter1,
typename _FIter2,
typename _BinaryPredicate>
254 find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
259 #ifdef __GXX_EXPERIMENTAL_CXX0X__
260 template<
typename _IIter,
typename _Predicate>
262 find_if_not(_IIter, _IIter, _Predicate);
269 template<
typename _IIter1,
typename _IIter2>
271 includes(_IIter1, _IIter1, _IIter2, _IIter2);
273 template<
typename _IIter1,
typename _IIter2,
typename _Compare>
275 includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
277 template<
typename _BIter>
279 inplace_merge(_BIter, _BIter, _BIter);
281 template<
typename _BIter,
typename _Compare>
283 inplace_merge(_BIter, _BIter, _BIter, _Compare);
285 #ifdef __GXX_EXPERIMENTAL_CXX0X__
286 template<
typename _RAIter>
288 is_heap(_RAIter, _RAIter);
290 template<
typename _RAIter,
typename _Compare>
292 is_heap(_RAIter, _RAIter, _Compare);
294 template<
typename _RAIter>
296 is_heap_until(_RAIter, _RAIter);
298 template<
typename _RAIter,
typename _Compare>
300 is_heap_until(_RAIter, _RAIter, _Compare);
302 template<
typename _IIter,
typename _Predicate>
304 is_partitioned(_IIter, _IIter, _Predicate);
306 template<
typename _FIter1,
typename _FIter2>
308 is_permutation(_FIter1, _FIter1, _FIter2);
310 template<
typename _FIter1,
typename _FIter2,
311 typename _BinaryPredicate>
313 is_permutation(_FIter1, _FIter1, _FIter2, _BinaryPredicate);
315 template<
typename _FIter>
317 is_sorted(_FIter, _FIter);
319 template<
typename _FIter,
typename _Compare>
321 is_sorted(_FIter, _FIter, _Compare);
323 template<
typename _FIter>
325 is_sorted_until(_FIter, _FIter);
327 template<
typename _FIter,
typename _Compare>
329 is_sorted_until(_FIter, _FIter, _Compare);
332 template<
typename _FIter1,
typename _FIter2>
334 iter_swap(_FIter1, _FIter2);
336 template<
typename _FIter,
typename _Tp>
338 lower_bound(_FIter, _FIter,
const _Tp&);
340 template<
typename _FIter,
typename _Tp,
typename _Compare>
342 lower_bound(_FIter, _FIter,
const _Tp&, _Compare);
344 template<
typename _RAIter>
346 make_heap(_RAIter, _RAIter);
348 template<
typename _RAIter,
typename _Compare>
350 make_heap(_RAIter, _RAIter, _Compare);
352 template<
typename _Tp>
354 max(
const _Tp&,
const _Tp&);
356 template<
typename _Tp,
typename _Compare>
358 max(
const _Tp&,
const _Tp&, _Compare);
363 template<
typename _Tp>
365 min(
const _Tp&,
const _Tp&);
367 template<
typename _Tp,
typename _Compare>
369 min(
const _Tp&,
const _Tp&, _Compare);
373 #ifdef __GXX_EXPERIMENTAL_CXX0X__
374 template<
typename _Tp>
375 pair<const _Tp&, const _Tp&>
376 minmax(
const _Tp&,
const _Tp&);
378 template<
typename _Tp,
typename _Compare>
379 pair<const _Tp&, const _Tp&>
380 minmax(
const _Tp&,
const _Tp&, _Compare);
382 template<
typename _FIter>
384 minmax_element(_FIter, _FIter);
386 template<
typename _FIter,
typename _Compare>
388 minmax_element(_FIter, _FIter, _Compare);
390 template<
typename _Tp>
392 min(initializer_list<_Tp>);
394 template<
typename _Tp,
typename _Compare>
396 min(initializer_list<_Tp>, _Compare);
398 template<
typename _Tp>
400 max(initializer_list<_Tp>);
402 template<
typename _Tp,
typename _Compare>
404 max(initializer_list<_Tp>, _Compare);
406 template<
typename _Tp>
408 minmax(initializer_list<_Tp>);
410 template<
typename _Tp,
typename _Compare>
412 minmax(initializer_list<_Tp>, _Compare);
417 template<
typename _BIter>
419 next_permutation(_BIter, _BIter);
421 template<
typename _BIter,
typename _Compare>
423 next_permutation(_BIter, _BIter, _Compare);
425 #ifdef __GXX_EXPERIMENTAL_CXX0X__
426 template<
typename _IIter,
typename _Predicate>
428 none_of(_IIter, _IIter, _Predicate);
434 template<
typename _IIter,
typename _RAIter>
436 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
438 template<
typename _IIter,
typename _RAIter,
typename _Compare>
440 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
444 #ifdef __GXX_EXPERIMENTAL_CXX0X__
445 template<
typename _IIter,
typename _OIter1,
446 typename _OIter2,
typename _Predicate>
447 pair<_OIter1, _OIter2>
448 partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate);
450 template<
typename _FIter,
typename _Predicate>
452 partition_point(_FIter, _FIter, _Predicate);
455 template<
typename _RAIter>
457 pop_heap(_RAIter, _RAIter);
459 template<
typename _RAIter,
typename _Compare>
461 pop_heap(_RAIter, _RAIter, _Compare);
463 template<
typename _BIter>
465 prev_permutation(_BIter, _BIter);
467 template<
typename _BIter,
typename _Compare>
469 prev_permutation(_BIter, _BIter, _Compare);
471 template<
typename _RAIter>
473 push_heap(_RAIter, _RAIter);
475 template<
typename _RAIter,
typename _Compare>
477 push_heap(_RAIter, _RAIter, _Compare);
481 template<
typename _FIter,
typename _Tp>
483 remove(_FIter, _FIter,
const _Tp&);
485 template<
typename _FIter,
typename _Predicate>
487 remove_if(_FIter, _FIter, _Predicate);
489 template<
typename _IIter,
typename _OIter,
typename _Tp>
491 remove_copy(_IIter, _IIter, _OIter,
const _Tp&);
493 template<
typename _IIter,
typename _OIter,
typename _Predicate>
495 remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
499 template<
typename _IIter,
typename _OIter,
typename _Tp>
501 replace_copy(_IIter, _IIter, _OIter,
const _Tp&,
const _Tp&);
503 template<
typename _Iter,
typename _OIter,
typename _Predicate,
typename _Tp>
505 replace_copy_if(_Iter, _Iter, _OIter, _Predicate,
const _Tp&);
509 template<
typename _BIter>
511 reverse(_BIter, _BIter);
513 template<
typename _BIter,
typename _OIter>
515 reverse_copy(_BIter, _BIter, _OIter);
517 template<
typename _FIter>
519 rotate(_FIter, _FIter, _FIter);
521 template<
typename _FIter,
typename _OIter>
523 rotate_copy(_FIter, _FIter, _FIter, _OIter);
532 #if defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
533 template<
typename _RAIter,
typename _UGenerator>
535 shuffle(_RAIter, _RAIter, _UGenerator&&);
538 template<
typename _RAIter>
540 sort_heap(_RAIter, _RAIter);
542 template<
typename _RAIter,
typename _Compare>
544 sort_heap(_RAIter, _RAIter, _Compare);
546 template<
typename _BIter,
typename _Predicate>
548 stable_partition(_BIter, _BIter, _Predicate);
550 template<
typename _Tp>
554 template<
typename _Tp,
size_t _Nm>
556 swap(_Tp (&)[_Nm], _Tp (&)[_Nm]);
558 template<
typename _FIter1,
typename _FIter2>
560 swap_ranges(_FIter1, _FIter1, _FIter2);
564 template<
typename _FIter>
566 unique(_FIter, _FIter);
568 template<
typename _FIter,
typename _BinaryPredicate>
570 unique(_FIter, _FIter, _BinaryPredicate);
574 template<
typename _FIter,
typename _Tp>
576 upper_bound(_FIter, _FIter,
const _Tp&);
578 template<
typename _FIter,
typename _Tp,
typename _Compare>
580 upper_bound(_FIter, _FIter,
const _Tp&, _Compare);
582 _GLIBCXX_END_NAMESPACE_VERSION
584 _GLIBCXX_BEGIN_NAMESPACE_ALGO
586 template<
typename _FIter>
588 adjacent_find(_FIter, _FIter);
590 template<
typename _FIter,
typename _BinaryPredicate>
592 adjacent_find(_FIter, _FIter, _BinaryPredicate);
594 template<
typename _IIter,
typename _Tp>
595 typename iterator_traits<_IIter>::difference_type
596 count(_IIter, _IIter,
const _Tp&);
598 template<
typename _IIter,
typename _Predicate>
599 typename iterator_traits<_IIter>::difference_type
600 count_if(_IIter, _IIter, _Predicate);
602 template<
typename _IIter1,
typename _IIter2>
604 equal(_IIter1, _IIter1, _IIter2);
606 template<
typename _IIter1,
typename _IIter2,
typename _BinaryPredicate>
608 equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
610 template<
typename _IIter,
typename _Tp>
612 find(_IIter, _IIter,
const _Tp&);
614 template<
typename _FIter1,
typename _FIter2>
616 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
618 template<
typename _FIter1,
typename _FIter2,
typename _BinaryPredicate>
620 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
622 template<
typename _IIter,
typename _Predicate>
624 find_if(_IIter, _IIter, _Predicate);
626 template<
typename _IIter,
typename _Funct>
628 for_each(_IIter, _IIter, _Funct);
630 template<
typename _FIter,
typename _Generator>
632 generate(_FIter, _FIter, _Generator);
634 template<
typename _OIter,
typename _Size,
typename _Generator>
636 generate_n(_OIter, _Size, _Generator);
638 template<
typename _IIter1,
typename _IIter2>
640 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
642 template<
typename _IIter1,
typename _IIter2,
typename _Compare>
644 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
646 template<
typename _FIter>
648 max_element(_FIter, _FIter);
650 template<
typename _FIter,
typename _Compare>
652 max_element(_FIter, _FIter, _Compare);
654 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
656 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
658 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
661 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
663 template<
typename _FIter>
665 min_element(_FIter, _FIter);
667 template<
typename _FIter,
typename _Compare>
669 min_element(_FIter, _FIter, _Compare);
671 template<
typename _IIter1,
typename _IIter2>
672 pair<_IIter1, _IIter2>
673 mismatch(_IIter1, _IIter1, _IIter2);
675 template<
typename _IIter1,
typename _IIter2,
typename _BinaryPredicate>
676 pair<_IIter1, _IIter2>
677 mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
679 template<
typename _RAIter>
681 nth_element(_RAIter, _RAIter, _RAIter);
683 template<
typename _RAIter,
typename _Compare>
685 nth_element(_RAIter, _RAIter, _RAIter, _Compare);
687 template<
typename _RAIter>
689 partial_sort(_RAIter, _RAIter, _RAIter);
691 template<
typename _RAIter,
typename _Compare>
693 partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
695 template<
typename _BIter,
typename _Predicate>
697 partition(_BIter, _BIter, _Predicate);
699 template<
typename _RAIter>
701 random_shuffle(_RAIter, _RAIter);
703 template<
typename _RAIter,
typename _Generator>
705 random_shuffle(_RAIter, _RAIter,
706 #ifdef __GXX_EXPERIMENTAL_CXX0X__
712 template<
typename _FIter,
typename _Tp>
714 replace(_FIter, _FIter,
const _Tp&,
const _Tp&);
716 template<
typename _FIter,
typename _Predicate,
typename _Tp>
718 replace_if(_FIter, _FIter, _Predicate,
const _Tp&);
720 template<
typename _FIter1,
typename _FIter2>
722 search(_FIter1, _FIter1, _FIter2, _FIter2);
724 template<
typename _FIter1,
typename _FIter2,
typename _BinaryPredicate>
726 search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
728 template<
typename _FIter,
typename _Size,
typename _Tp>
730 search_n(_FIter, _FIter, _Size,
const _Tp&);
732 template<
typename _FIter,
typename _Size,
typename _Tp,
733 typename _BinaryPredicate>
735 search_n(_FIter, _FIter, _Size,
const _Tp&, _BinaryPredicate);
737 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
739 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
741 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
744 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
746 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
748 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
750 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
753 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
755 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
757 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
759 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
762 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
765 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
767 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
769 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
772 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
774 template<
typename _RAIter>
776 sort(_RAIter, _RAIter);
778 template<
typename _RAIter,
typename _Compare>
780 sort(_RAIter, _RAIter, _Compare);
782 template<
typename _RAIter>
784 stable_sort(_RAIter, _RAIter);
786 template<
typename _RAIter,
typename _Compare>
788 stable_sort(_RAIter, _RAIter, _Compare);
790 template<
typename _IIter,
typename _OIter,
typename _UnaryOperation>
792 transform(_IIter, _IIter, _OIter, _UnaryOperation);
794 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
795 typename _BinaryOperation>
797 transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
799 template<
typename _IIter,
typename _OIter>
801 unique_copy(_IIter, _IIter, _OIter);
803 template<
typename _IIter,
typename _OIter,
typename _BinaryPredicate>
805 unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
807 _GLIBCXX_END_NAMESPACE_ALGO
810 #ifdef _GLIBCXX_PARALLEL
pair< _InputIterator, _OutputIterator > copy_n(_InputIterator __first, _Size __count, _OutputIterator __result)
Copies the range [first,first+count) into [result,result+count).
const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
pair< const _Tp &, const _Tp & > minmax(const _Tp &, const _Tp &)
Determines min and max at once as an ordered pair.
size_t count() const
Returns the number of bits which are set.
const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.