1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| // Nonmodifying Algorithms // ----------------------------------- // Counting Elements // ----------------------------------- difference_type count (InputIterator beg, InputIterator end, const T& value) difference_type count_if (InputIterator beg, InputIterator end, UnaryPredicate op) // ----------------------------------- // Minimum and Maximum // ----------------------------------- ForwardIterator min_element (ForwardIterator beg, ForwardIterator end) ForwardIterator min_element (ForwardIterator beg, ForwardIterator end, CompFunc op) ForwardIterator max_element (ForwardIterator beg, ForwardIterator end) ForwardIterator max_element (ForwardIterator beg, ForwardIterator end, CompFunc op) pair<ForwardIterator, ForwardIterator> minmax_element(ForwardIterator beg, ForwardIterator end) pair<ForwardIterator, ForwardIterator> minmax_element(ForwardIterator beg, ForwardIterator end, CompFunc op) // ----------------------------------- // Searching Elements // ----------------------------------- // - Search First Matching Element InputIterator find (InputIterator beg, InputIterator end, const T& value) InputIterator find_if (InputIterator beg, InputIterator end, UnaryPredicate op) InputIterator find_if_not (InputIterator beg, InputIterator end, UnaryPredicate op) // - Search First n Matching Consecutive(连贯的) Elements ForwardIterator search_n (ForwardIterator beg, ForwardIterator end, Size count, const T& value) ForwardIterator search_n (ForwardIterator beg, ForwardIterator end, Size count, const T& value, BinaryPredicate op) // - Search First Subrange ForwardIterator1 search (ForwardIterator1 beg, ForwardIterator1 end, ForwardIterator2 searchBeg, ForwardIterator2 searchEnd) ForwardIterator1 search (ForwardIterator1 beg, ForwardIterator1 end, ForwardIterator2 searchBeg, ForwardIterator2 searchEnd, BinaryPredicate op) // - Search Last Subrange ForwardIterator1 find_end (ForwardIterator1 beg, ForwardIterator1 end, ForwardIterator2 searchBeg, ForwardIterator2 searchEnd) ForwardIterator1 find_end (ForwardIterator1 beg, ForwardIterator1 end, ForwardIterator2 searchBeg, ForwardIterator2 searchEnd, BinaryPredicate op) // - Search First of Several Possible Elements InputIterator find_first_of (InputIterator beg, InputIterator end, ForwardIterator searchBeg, ForwardIterator searchEnd) InputIterator find_first_of (InputIterator beg, InputIterator end, ForwardIterator searchBeg, ForwardIterator searchEnd, BinaryPredicate op) // - Search Two Adjacent, Equal Elements ForwardIterator adjacent_find (ForwardIterator beg, ForwardIterator end) ForwardIterator adjacent_find (ForwardIterator beg, ForwardIterator end, BinaryPredicate op) // ----------------------------------- // Comparing Ranges // ----------------------------------- // - Testing Equality bool equal (InputIterator1 beg, InputIterator1 end, InputIterator2 cmpBeg) bool equal (InputIterator1 beg, InputIterator1 end, InputIterator2 cmpBeg, BinaryPredicate op) // - Testing for Unordered Equality bool is_permutation (ForwardIterator1 beg1, ForwardIterator1 end1, ForwardIterator2 beg2) bool is_permutation (ForwardIterator1 beg1, ForwardIterator1 end1, ForwardIterator2 beg2, CompFunc op) // - Search the First Difference pair<InputIterator1, InputIterator2> mismatch (InputIterator1 beg, InputIterator1 end, InputIterator2 cmpBeg) pair<InputIterator1, InputIterator2> mismatch (InputIterator1 beg, InputIterator1 end, InputIterator2 cmpBeg, BinaryPredicate op) // - Testing for "Less Than" bool lexicographical_compare (InputIterator1 beg1, InputIterator1 end1, InputIterator2 beg2, InputIterator2 end2) bool lexicographical_compare (InputIterator1 beg1, InputIterator1 end1, InputIterator2 beg2, InputIterator2 end2, CompFunc op) // ----------------------------------- // Predicates for Ranges // ----------------------------------- // - Check for (Partial) Sorting bool is_sorted (ForwardIterator beg, ForwardIterator end) bool is_sorted (ForwardIterator beg, ForwardIterator end, BinaryPredicate op) ForwardIterator is_sorted_until (ForwardIterator beg, ForwardIterator end) ForwardIterator is_sorted_until (ForwardIterator beg, ForwardIterator end, BinaryPredicate op) // - Check for Being Partitioned bool is_partitioned (InputIterator beg, InputIterator end, UnaryPredicate op) ForwardIterator partition_point (ForwardIterator beg, ForwareIterator end, BinaryPredicate op) // - Check for Being a Heap (Maximum Element First) bool is_heap (RandomAccessIterator beg, RandomAccessIterator end) bool is_heap (RandomAccessIterator beg, RandomAccessIterator end, BinaryPredicate op) RandomAccessIterator is_heap_until (RandomAccessIterator beg, RandomAccessIterator end) RandomAccessIterator is_heap_until (RandomAccessIterator beg, RandomAccessIterator end, BinaryPredicate op) // - All, Any, or None bool all_of (InputIterator beg, InputIterator end, UnaryPredicate op) bool any_of (InputIterator beg, InputIterator end, UnaryPredicate op) bool none_of (InputIterator beg, InputIterator end, UnaryPredicate op)
|