Standard C++ Library Reference ISO/IEC (VERSION3)
with pred(X, Y).
push_heap
template<class RanIt>
void push_heap(RanIt first, RanIt last);
template<class RanIt, class Pr>
void push_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 new heap ordered by operator<. Iterators in the range [first, last -
1) must designate an existing heap, also ordered by operator<. Thus, first != last
must be true and *(last - 1) is the element to add to (push on) the heap.
The function evaluates the ordering predicate X < Y at most ceil(log(last - first))
times.
The second template function behaves the same, except that it replaces operator<(X, Y)
with pred(X, Y).
random_shuffle
template<class RanIt>
void random_shuffle(RanIt first, RanIt last);
template<class RanIt, class Fn1>
void random_shuffle(RanIt first, RanIt last, Fn1& func);
The first template function evaluates swap(*(first + N), *(first + M)) once for
each N in the range [1, last - first), where M is a value from some uniform random
distribution over the range [0, N]. Thus, the function randomly shuffles the order of elements
in the sequence.
The function evaluates M and calls swap exactly last - first - 1 times.
The second template function behaves the same, except that M is (Diff)func((Diff)N),
where Diff is the type iterator_traits<RanIt>:: difference_type.
remove
template<class FwdIt, class Ty>
FwdIt remove(FwdIt first, FwdIt last, const Ty& val);
The template function effectively assigns first to X, then executes the statement:
if (!(*(first + N) == val))
*X++ = *(first + N);