Standard C++ Library Reference ISO/IEC (VERSION3)
The template function evaluates *(dest + N) = *(last - 1 - N) once for each N in
the range [0, last - first). It then returns dest + (last - first). Thus, the
function reverses the order of elements in the sequence that it copies.
If dest and first designate regions of storage, the range [dest, dest + (last -
first)) must not overlap the range [first, last).
rotate
template<class FwdIt>
void rotate(FwdIt first, FwdIt mid, FwdIt last);
The template function leaves the value originally stored in *(first + (N + (mid -
first)) % (last - first)) subsequently stored in *(first + N) for each N in the
range [0, last - first). Thus, if a ``left'' shift by one element leaves the element
originally stored in *(first + (N + 1) % (last - first)) subsequently stored in
*(first + N), then the function can be said to rotate the sequence either left by mid -
first elements or right by last - mid elements. Both [first, mid) and [mid,
last) must be valid ranges. The function swaps at most last - first pairs of elements.
rotate_copy
template<class FwdIt, class OutIt>
OutIt rotate_copy(FwdIt first, FwdIt mid,
FwdIt last, OutIt dest);
The template function evaluates *(dest + N) = *(first + (N + (mid - first))
% (last - first)) once for each N in the range [0, last - first). Thus, if a
``left'' shift by one element leaves the element originally stored in *(first + (N + 1) %
(last - first)) subsequently stored in *(first + N), then the function can be said to
rotate the sequence either left by mid - first elements or right by last - mid elements
as it copies. Both [first, mid) and [mid, last) must be valid ranges. The function
returns the iterator value that designates the end of the resulting sequence.
If dest and first designate regions of storage, the range [dest, dest + (last -
first)) must not overlap the range [first, last).
search
template<class FwdIt1, class FwdIt2>
FwdIt1 search(FwdIt1 first1, FwdIt1 last1,
FwdIt2 first2, FwdIt2 last2);
template<class FwdIt1, class FwdIt2, class Pr>
FwdIt1 search(FwdIt1 first1, FwdIt1 last1,
FwdIt2 first2, FwdIt2 last2, Pr pred);