Standard C++ Library Reference ISO/IEC (VERSION3)
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).
min_element
template<class FwdIt>
FwdIt min_element(FwdIt first, FwdIt last);
template<class FwdIt, class Pr>
FwdIt min_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 +
M) < *(first + N) is false. It then returns first + N. Thus, the function determines the
lowest position that contains the smallest value in the sequence.
The function evaluates the ordering predicate X < Y exactly max((last - first) - 1,
0) times.
The second template function behaves the same, except that it replaces operator<(X, Y)
with pred(X, Y).
mismatch
template<class InIt1, class InIt2>
pair<InIt1, InIt2> mismatch(InIt1 first1, InIt1 last1,
InIt2 first2);
template<class InIt1, class InIt2, class Pr>
pair<InIt1, InIt2> mismatch(InIt1 first1, InIt1 last1,
InIt2 first2, Pr pred);
The first template function determines the lowest value of N in the range [0, last1 -
first1) for which the predicate !(*(first1 + N) == *(first2 + N)) is true.
Here, operator== must perform a pairwise comparison between its operands. It then returns
pair(first1 + N, first2 + N). If no such value exists, N has the value last1 -
first1. The function evaluates the predicate at most once for each N.
The second template function behaves the same, except that the predicate is pred(*(first1
+ N), *(first2 + N)).
next_permutation
template<class BidIt>
bool next_permutation(BidIt first, BidIt last);