template < class InputIterator, class T >
InputIterator find(InputIterator first, InputIterator last,
const T& value) {
while (first != last && *first != value) ++first;
return first;
}
There is also often a predicate version which takes a function object argument as
well as an iterator type:
template < class InputIterator, class Predicate >
InputIterator find_if(InputIterator first, InputIterator last,
Predicate pred) {
while (first != last && !pred(*first)) ++first;
return first;
}
In addition, mutating operators often have a copy version that does not change
the original range but does its job on a new range built from copying the range (using an
output iterator). For example:
template < class InputIterator, class OutputIterator, class T >
OutputIterator replace_copy(InputIterator first,
InputIterator last,
OutputIterator result,
const T& old_value,
const T& new_value) {
while (first != last) {
*result++ = *first == old_value ?
new_value :
*first; ++first; }
return result;
}
for_each()find()find_if().
find_end()find_first_of()adjacent_find()count()mismatch()equal()search()copy()copy_backward().
swap()iter_swap (swaps two elements pointed by iterators).
swap_ranges (swaps two ranges).
transform()replace()replace_copy(), replace_if(), replace_copy_if().
fill()fill_n.
generate()generate_n.
remove()remove_if(), remove_copy(), remove_copy_if.
unique()unique_if(), unique_copy(), unique_copy_if().
reverse()reverse_copy().
rotate()rotate_copy().
random_shuffle()partition()stable_partition().
sort()stable_sort()partial_sort()partial_sort_copy().
nth_element()lower_bound()upper_bound()equal_range()lower_bound() and upper_bound().
binary_search()merge()inplace_merge() (merges two consecutive ranges).
includes()set_union()set_intersection()set_difference()set_symmetric_difference()push_heap()pop_heap()make_heap()sort_heap()accumulate()inner_product()partial_sum()adjacent_differences()min()max()min_element()max_element()lexicographical_compare()next_permutation()prev_permutation()