30#ifndef _GLIBCXX_ALGORITHMFWD_H
31#define _GLIBCXX_ALGORITHMFWD_H 1
33#pragma GCC system_header
38#if __cplusplus >= 201103L
42namespace std _GLIBCXX_VISIBILITY(default)
44_GLIBCXX_BEGIN_NAMESPACE_VERSION
194#if __cplusplus > 201703L
195# define __cpp_lib_constexpr_algorithms 201806L
198#if __cplusplus >= 201103L
199 template<
typename _IIter,
typename _Predicate>
202 all_of(_IIter, _IIter, _Predicate);
204 template<
typename _IIter,
typename _Predicate>
207 any_of(_IIter, _IIter, _Predicate);
210 template<
typename _FIter,
typename _Tp>
213 binary_search(_FIter, _FIter,
const _Tp&);
215 template<
typename _FIter,
typename _Tp,
typename _Compare>
218 binary_search(_FIter, _FIter,
const _Tp&, _Compare);
220#if __cplusplus > 201402L
221 template<
typename _Tp>
224 clamp(
const _Tp&,
const _Tp&,
const _Tp&);
226 template<
typename _Tp,
typename _Compare>
229 clamp(
const _Tp&,
const _Tp&,
const _Tp&, _Compare);
232 template<
typename _IIter,
typename _OIter>
235 copy(_IIter, _IIter, _OIter);
237 template<
typename _BIter1,
typename _BIter2>
240 copy_backward(_BIter1, _BIter1, _BIter2);
242#if __cplusplus >= 201103L
243 template<
typename _IIter,
typename _OIter,
typename _Predicate>
246 copy_if(_IIter, _IIter, _OIter, _Predicate);
248 template<
typename _IIter,
typename _Size,
typename _OIter>
251 copy_n(_IIter, _Size, _OIter);
257 template<
typename _FIter,
typename _Tp>
260 equal_range(_FIter, _FIter,
const _Tp&);
262 template<
typename _FIter,
typename _Tp,
typename _Compare>
265 equal_range(_FIter, _FIter,
const _Tp&, _Compare);
267 template<
typename _FIter,
typename _Tp>
270 fill(_FIter, _FIter,
const _Tp&);
272 template<
typename _OIter,
typename _Size,
typename _Tp>
275 fill_n(_OIter, _Size,
const _Tp&);
279 template<
typename _FIter1,
typename _FIter2>
282 find_end(_FIter1, _FIter1, _FIter2, _FIter2);
284 template<
typename _FIter1,
typename _FIter2,
typename _BinaryPredicate>
287 find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
292#if __cplusplus >= 201103L
293 template<
typename _IIter,
typename _Predicate>
296 find_if_not(_IIter, _IIter, _Predicate);
303 template<
typename _IIter1,
typename _IIter2>
306 includes(_IIter1, _IIter1, _IIter2, _IIter2);
308 template<
typename _IIter1,
typename _IIter2,
typename _Compare>
311 includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
313 template<
typename _BIter>
315 inplace_merge(_BIter, _BIter, _BIter);
317 template<
typename _BIter,
typename _Compare>
319 inplace_merge(_BIter, _BIter, _BIter, _Compare);
321#if __cplusplus >= 201103L
322 template<
typename _RAIter>
325 is_heap(_RAIter, _RAIter);
327 template<
typename _RAIter,
typename _Compare>
330 is_heap(_RAIter, _RAIter, _Compare);
332 template<
typename _RAIter>
335 is_heap_until(_RAIter, _RAIter);
337 template<
typename _RAIter,
typename _Compare>
340 is_heap_until(_RAIter, _RAIter, _Compare);
342 template<
typename _IIter,
typename _Predicate>
345 is_partitioned(_IIter, _IIter, _Predicate);
347 template<
typename _FIter1,
typename _FIter2>
350 is_permutation(_FIter1, _FIter1, _FIter2);
352 template<
typename _FIter1,
typename _FIter2,
353 typename _BinaryPredicate>
356 is_permutation(_FIter1, _FIter1, _FIter2, _BinaryPredicate);
358 template<
typename _FIter>
361 is_sorted(_FIter, _FIter);
363 template<
typename _FIter,
typename _Compare>
366 is_sorted(_FIter, _FIter, _Compare);
368 template<
typename _FIter>
371 is_sorted_until(_FIter, _FIter);
373 template<
typename _FIter,
typename _Compare>
376 is_sorted_until(_FIter, _FIter, _Compare);
379 template<
typename _FIter1,
typename _FIter2>
382 iter_swap(_FIter1, _FIter2);
384 template<
typename _FIter,
typename _Tp>
387 lower_bound(_FIter, _FIter,
const _Tp&);
389 template<
typename _FIter,
typename _Tp,
typename _Compare>
392 lower_bound(_FIter, _FIter,
const _Tp&, _Compare);
394 template<
typename _RAIter>
397 make_heap(_RAIter, _RAIter);
399 template<
typename _RAIter,
typename _Compare>
402 make_heap(_RAIter, _RAIter, _Compare);
404 template<
typename _Tp>
407 max(
const _Tp&,
const _Tp&);
409 template<
typename _Tp,
typename _Compare>
412 max(
const _Tp&,
const _Tp&, _Compare);
417 template<
typename _Tp>
420 min(
const _Tp&,
const _Tp&);
422 template<
typename _Tp,
typename _Compare>
425 min(
const _Tp&,
const _Tp&, _Compare);
429#if __cplusplus >= 201103L
430 template<
typename _Tp>
432 pair<const _Tp&, const _Tp&>
433 minmax(
const _Tp&,
const _Tp&);
435 template<
typename _Tp,
typename _Compare>
437 pair<const _Tp&, const _Tp&>
438 minmax(
const _Tp&,
const _Tp&, _Compare);
440 template<
typename _FIter>
443 minmax_element(_FIter, _FIter);
445 template<
typename _FIter,
typename _Compare>
448 minmax_element(_FIter, _FIter, _Compare);
450 template<
typename _Tp>
453 min(initializer_list<_Tp>);
455 template<
typename _Tp,
typename _Compare>
458 min(initializer_list<_Tp>, _Compare);
460 template<
typename _Tp>
463 max(initializer_list<_Tp>);
465 template<
typename _Tp,
typename _Compare>
468 max(initializer_list<_Tp>, _Compare);
470 template<
typename _Tp>
473 minmax(initializer_list<_Tp>);
475 template<
typename _Tp,
typename _Compare>
478 minmax(initializer_list<_Tp>, _Compare);
483 template<
typename _BIter>
486 next_permutation(_BIter, _BIter);
488 template<
typename _BIter,
typename _Compare>
491 next_permutation(_BIter, _BIter, _Compare);
493#if __cplusplus >= 201103L
494 template<
typename _IIter,
typename _Predicate>
497 none_of(_IIter, _IIter, _Predicate);
503 template<
typename _IIter,
typename _RAIter>
506 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
508 template<
typename _IIter,
typename _RAIter,
typename _Compare>
511 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
515#if __cplusplus >= 201103L
516 template<
typename _IIter,
typename _OIter1,
517 typename _OIter2,
typename _Predicate>
519 pair<_OIter1, _OIter2>
520 partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate);
522 template<
typename _FIter,
typename _Predicate>
525 partition_point(_FIter, _FIter, _Predicate);
528 template<
typename _RAIter>
531 pop_heap(_RAIter, _RAIter);
533 template<
typename _RAIter,
typename _Compare>
536 pop_heap(_RAIter, _RAIter, _Compare);
538 template<
typename _BIter>
541 prev_permutation(_BIter, _BIter);
543 template<
typename _BIter,
typename _Compare>
546 prev_permutation(_BIter, _BIter, _Compare);
548 template<
typename _RAIter>
551 push_heap(_RAIter, _RAIter);
553 template<
typename _RAIter,
typename _Compare>
556 push_heap(_RAIter, _RAIter, _Compare);
560 template<
typename _FIter,
typename _Tp>
563 remove(_FIter, _FIter,
const _Tp&);
565 template<
typename _FIter,
typename _Predicate>
568 remove_if(_FIter, _FIter, _Predicate);
570 template<
typename _IIter,
typename _OIter,
typename _Tp>
573 remove_copy(_IIter, _IIter, _OIter,
const _Tp&);
575 template<
typename _IIter,
typename _OIter,
typename _Predicate>
578 remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
582 template<
typename _IIter,
typename _OIter,
typename _Tp>
585 replace_copy(_IIter, _IIter, _OIter,
const _Tp&,
const _Tp&);
587 template<
typename _Iter,
typename _OIter,
typename _Predicate,
typename _Tp>
590 replace_copy_if(_Iter, _Iter, _OIter, _Predicate,
const _Tp&);
594 template<
typename _BIter>
597 reverse(_BIter, _BIter);
599 template<
typename _BIter,
typename _OIter>
602 reverse_copy(_BIter, _BIter, _OIter);
606 template<
typename _FIter>
609 rotate(_FIter, _FIter, _FIter);
612 template<
typename _FIter,
typename _OIter>
615 rotate_copy(_FIter, _FIter, _FIter, _OIter);
624#if (__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
625 template<
typename _RAIter,
typename _UGenerator>
627 shuffle(_RAIter, _RAIter, _UGenerator&&);
630 template<
typename _RAIter>
633 sort_heap(_RAIter, _RAIter);
635 template<
typename _RAIter,
typename _Compare>
638 sort_heap(_RAIter, _RAIter, _Compare);
640 template<
typename _BIter,
typename _Predicate>
642 stable_partition(_BIter, _BIter, _Predicate);
644#if __cplusplus < 201103L
647 template<
typename _Tp,
size_t _Nm>
650 swap(_Tp& __a, _Tp& __b);
652 template<
typename _Tp,
size_t _Nm>
655 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]);
658 template<
typename _FIter1,
typename _FIter2>
661 swap_ranges(_FIter1, _FIter1, _FIter2);
665 template<
typename _FIter>
668 unique(_FIter, _FIter);
670 template<
typename _FIter,
typename _BinaryPredicate>
673 unique(_FIter, _FIter, _BinaryPredicate);
677 template<
typename _FIter,
typename _Tp>
680 upper_bound(_FIter, _FIter,
const _Tp&);
682 template<
typename _FIter,
typename _Tp,
typename _Compare>
685 upper_bound(_FIter, _FIter,
const _Tp&, _Compare);
687_GLIBCXX_BEGIN_NAMESPACE_ALGO
689 template<
typename _FIter>
692 adjacent_find(_FIter, _FIter);
694 template<
typename _FIter,
typename _BinaryPredicate>
697 adjacent_find(_FIter, _FIter, _BinaryPredicate);
699 template<
typename _IIter,
typename _Tp>
701 typename iterator_traits<_IIter>::difference_type
702 count(_IIter, _IIter,
const _Tp&);
704 template<
typename _IIter,
typename _Predicate>
706 typename iterator_traits<_IIter>::difference_type
707 count_if(_IIter, _IIter, _Predicate);
709 template<
typename _IIter1,
typename _IIter2>
712 equal(_IIter1, _IIter1, _IIter2);
714 template<
typename _IIter1,
typename _IIter2,
typename _BinaryPredicate>
717 equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
719 template<
typename _IIter,
typename _Tp>
722 find(_IIter, _IIter,
const _Tp&);
724 template<
typename _FIter1,
typename _FIter2>
727 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
729 template<
typename _FIter1,
typename _FIter2,
typename _BinaryPredicate>
732 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
734 template<
typename _IIter,
typename _Predicate>
737 find_if(_IIter, _IIter, _Predicate);
739 template<
typename _IIter,
typename _Funct>
742 for_each(_IIter, _IIter, _Funct);
744 template<
typename _FIter,
typename _Generator>
747 generate(_FIter, _FIter, _Generator);
749 template<
typename _OIter,
typename _Size,
typename _Generator>
752 generate_n(_OIter, _Size, _Generator);
754 template<
typename _IIter1,
typename _IIter2>
757 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
759 template<
typename _IIter1,
typename _IIter2,
typename _Compare>
762 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
764 template<
typename _FIter>
767 max_element(_FIter, _FIter);
769 template<
typename _FIter,
typename _Compare>
772 max_element(_FIter, _FIter, _Compare);
774 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
777 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
779 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
783 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
785 template<
typename _FIter>
788 min_element(_FIter, _FIter);
790 template<
typename _FIter,
typename _Compare>
793 min_element(_FIter, _FIter, _Compare);
795 template<
typename _IIter1,
typename _IIter2>
797 pair<_IIter1, _IIter2>
798 mismatch(_IIter1, _IIter1, _IIter2);
800 template<
typename _IIter1,
typename _IIter2,
typename _BinaryPredicate>
802 pair<_IIter1, _IIter2>
803 mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
805 template<
typename _RAIter>
808 nth_element(_RAIter, _RAIter, _RAIter);
810 template<
typename _RAIter,
typename _Compare>
813 nth_element(_RAIter, _RAIter, _RAIter, _Compare);
815 template<
typename _RAIter>
818 partial_sort(_RAIter, _RAIter, _RAIter);
820 template<
typename _RAIter,
typename _Compare>
823 partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
825 template<
typename _BIter,
typename _Predicate>
828 partition(_BIter, _BIter, _Predicate);
830 template<
typename _RAIter>
832 random_shuffle(_RAIter, _RAIter);
834 template<
typename _RAIter,
typename _Generator>
836 random_shuffle(_RAIter, _RAIter,
837#
if __cplusplus >= 201103L
843 template<
typename _FIter,
typename _Tp>
846 replace(_FIter, _FIter,
const _Tp&,
const _Tp&);
848 template<
typename _FIter,
typename _Predicate,
typename _Tp>
851 replace_if(_FIter, _FIter, _Predicate,
const _Tp&);
853 template<
typename _FIter1,
typename _FIter2>
856 search(_FIter1, _FIter1, _FIter2, _FIter2);
858 template<
typename _FIter1,
typename _FIter2,
typename _BinaryPredicate>
861 search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
863 template<
typename _FIter,
typename _Size,
typename _Tp>
866 search_n(_FIter, _FIter, _Size,
const _Tp&);
868 template<
typename _FIter,
typename _Size,
typename _Tp,
869 typename _BinaryPredicate>
872 search_n(_FIter, _FIter, _Size,
const _Tp&, _BinaryPredicate);
874 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
877 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
879 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
883 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
885 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
888 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
890 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
894 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
896 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
899 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
901 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
905 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
908 template<
typename _IIter1,
typename _IIter2,
typename _OIter>
911 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
913 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
917 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
919 template<
typename _RAIter>
922 sort(_RAIter, _RAIter);
924 template<
typename _RAIter,
typename _Compare>
927 sort(_RAIter, _RAIter, _Compare);
929 template<
typename _RAIter>
931 stable_sort(_RAIter, _RAIter);
933 template<
typename _RAIter,
typename _Compare>
935 stable_sort(_RAIter, _RAIter, _Compare);
937 template<
typename _IIter,
typename _OIter,
typename _UnaryOperation>
940 transform(_IIter, _IIter, _OIter, _UnaryOperation);
942 template<
typename _IIter1,
typename _IIter2,
typename _OIter,
943 typename _BinaryOperation>
946 transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
948 template<
typename _IIter,
typename _OIter>
951 unique_copy(_IIter, _IIter, _OIter);
953 template<
typename _IIter,
typename _OIter,
typename _BinaryPredicate>
956 unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
958_GLIBCXX_END_NAMESPACE_ALGO
959_GLIBCXX_END_NAMESPACE_VERSION
962#ifdef _GLIBCXX_PARALLEL
void swap(any &__x, any &__y) noexcept
Exchange the states of two any objects.
constexpr const _Tp & clamp(const _Tp &, const _Tp &, const _Tp &)
Returns the value clamped between lo and hi.
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.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
ISO C++ entities toplevel namespace is std.