cpp/algorithm/rotate

@1@ Performs a left rotation on a range of elements.

@@Specifically, swaps the elements in the range  in such a way that the elements in  are placed after the elements in  while the orders of the elements in both ranges are preserved.

@2@ Same as, but executed according to.

If or  is not a valid range, the behavior is undefined.

Return value
An iterator that is equal to:
 * , if is ,
 * , if is ,
 * otherwise, i.e. the new location of the element pointed by.

Complexity
Linear in the distance between and.

Possible implementation
See also the implementations in libstdc++, libc++, and MSVC STL.