Table of Contents
Previous Section Next Section

rotate and rotate_copy

template <class ForIter>  void rotate(ForIter start, ForIter mid, ForIter end);template <class ForIter, class OutIter>
    OutIter rotate_copy(ForIter start, ForIter mid,
                        ForIter end, OutIter result);

The rotate( ) algorithm left-rotates the elements in the range specified by start and end so that the element specified by mid becomes the new first element.

The rotate_copy( ) algorithm copies the range specified by start and end, storing the result in result. In the process, it left-rotates the elements so that the element specified by mid becomes the new first element. It returns an iterator to the end of result.


Table of Contents
Previous Section Next Section