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
|
hi(max_element) hi(min_element) hi(minmax_element)
itemization(
it() Header file: tt(<algorithm>)
it() Function prototypes:
itemization(
itt(ForwardIterator max_element([ExecPol,] ForwardIterator first,
ForwardIterator last);)
itt(ForwardIterator max_element([ExecPol,] ForwardIterator first,
ForwardIterator last, BinaryPredicate pred);)
itt(ForwardIterator min_element([ExecPol,] ForwardIterator first,
ForwardIterator last);)
itt(ForwardIterator min_element([ExecPol,] ForwardIterator first,
ForwardIterator last, BinaryPredicate pred);)
itt(pair<ForwardIterator, ForwardIterator> max_element([ExecPol,]
ForwardIterator first,ForwardIterator last);)
itt(pair<ForwardIterator, ForwardIterator> max_element([ExecPol,]
ForwardIterator first,ForwardIterator last,
BinaryPredicate pred);)
)
it() Description:
itemization(
it() The first prototype: an iterator pointing to the largest
element reached from the iterator range rangett(first, last) is returned. The
ti(operator<) of the data type to which the iterators point is used to decide
which of the elements is the largest.
it() The second prototype: rather than using tt(operator<), the
binary predicate tt(pred) is used to make the comparisons between the elements
reached from the iterator range rangett(first, last). The element for which
tt(pred) returns most often tt(true), compared with other elements, is
returned.
it() Prototypes three and four act identically to, respectively,
prototypes one and two, using tt(std::min_element) instead of
tt(std::max_element), returning iterators to the smallest elements in the
iterator ranges rangett(first, last).
it() The final two prototypes act identically to, respectively,
prototypes one and two, but return tt(std::pair) objects whose tt(first)
members contain the iterators returned by the tt(min) generic algorithms and
whose tt(second) members contain the iterators returned by the tt(max) generic
algorithms.
)
it() Example:
verbinclude(-a examples/maxelement.cc)
)
|