Standard C++ Library Reference ISO/IEC (VERSION3)

ordered by operator<. It then returns first + N. Thus, the function determines the lowest
position before which val can be inserted in the sequence and still preserve its ordering.
The function evaluates the ordering predicate X < Y at most ceil(log(last - first))
+ 1 times.
The second template function behaves the same, except that it replaces operator<(X, Y)
with pred(X, Y).
make_heap
template<class RanIt>
void make_heap(RanIt first, RanIt last);
template<class RanIt, class Pr>
void make_heap(RanIt first, RanIt last, Pr pred);
The first template function reorders the sequence designated by iterators in the range [first,
last) to form a heap ordered by operator<.
The function evaluates the ordering predicate X < Y at most 3 * (last - first) times.
The second template function behaves the same, except that it replaces operator<(X, Y)
with pred(X, Y).
max
template<class Ty>
const Ty& max(const Ty& left, const Ty& right);
template<class Ty, class Pr>
const Ty& max(const Ty& left, const Ty& right, Pr pred);
The first template function returns right if left < right. Otherwise it returns left. Ty
need supply only a single-argument constructor and a destructor.
The second template function behaves the same, except that it replaces operator<(X, Y)
with pred(X, Y).
max_element
template<class FwdIt>
FwdIt max_element(FwdIt first, FwdIt last);
template<class FwdIt, class Pr>
FwdIt max_element(FwdIt first, FwdIt last, Pr pred);
The first template function determines the lowest value of N in the range [0, last -
first) such that, for each M in the range [0, last - first) the predicate *(first +