rotate_copy function template — Rotates and copies items in a range
template<typename FwdIter, typename OutIter>
OutIter rotate_copy(FwdIter first, FwdIter middle, FwdIter last,
OutIter result);
The rotate_copy
function
template copies elements from the range [middle
, last
) to the range that starts at result
followed by the elements from
[first
, middle
), thereby effecting a rotation to
the left. The return value is one past the end of the result
range.
The source and result ranges must not overlap. Figure 13-16 shows an example of rotation.