Standard C++ Library Reference ISO/IEC (VERSION3)
The second template function behaves the same, except that it replaces operator<(X, Y)
with pred(X, Y).
iter_swap
template<class FwdIt1, class FwdIt2>
void iter_swap(FwdIt1 left, FwdIt2 right);
The template function leaves the value originally stored in *right subsequently stored in
*left, and the value originally stored in *left subsequently stored in *right.
lexicographical_compare
template<class InIt1, class InIt2>
bool lexicographical_compare(InIt1 first1,
InIt1 last1, InIt2 first2, InIt2 last2);
template<class InIt1, class InIt2, class Pr>
bool lexicographical_compare(InIt1 first1,
InIt1 last1, InIt2 first2, InIt2 last2, Pr pred);
The first template function determines K, the number of elements to compare as the smaller of
last1 - first1 and last2 - first2. It then determines the lowest value of N in the
range [0, K) for which *(first1 + N) and *(first2 + N) do not have equivalent
ordering. If no such value exists, the function returns true only if K < (last2 - first2).
Otherwise, it returns true only if *(first1 + N) < *(first2 + N). Thus, the function
returns true only if the sequence designated by iterators in the range [first1, last1) is
lexicographically less than the other sequence.
The function evaluates the ordering predicate X < Y at most 2 * K times.
The second template function behaves the same, except that it replaces operator<(X, Y)
with pred(X, Y).
lower_bound
template<class FwdIt, class Ty>
FwdIt lower_bound(FwdIt first, FwdIt last,
const Ty& val);
template<class FwdIt, class Ty, class Pr>
FwdIt lower_bound(FwdIt first, FwdIt last,
const Ty& val, Pr pred);
The first template function determines the highest value of N in the range (0, last -
first] such that, for each M in the range [0, N) the predicate *(first + M) < val is
true, where the elements designated by iterators in the range [first, last) form a sequence