Table of Contents
Previous Section Next Section

max_element

template <class ForIter>    ForIter max_element(ForIter start, ForIter end);
template <class ForIter, class Comp>
    ForIter max_element(ForIter start, ForIter end, Comp cmpfn);

The max_element( ) algorithm returns an iterator to the maximum element within the range start and end.

The second form allows you to specify a comparison function that determines when one element is less than another.


Table of Contents
Previous Section Next Section