cpp/algorithm/shift

Shifts the elements in the range by  positions.

@1@ Shifts the elements towards the beginning of the range. If, there are no effects. If, the behavior is undefined. Otherwise, for every integer in, moves the element originally at position  to position. The moves are performed in increasing order of starting from.

@3@ Shifts the elements towards the end of the range. If, there are no effects. If, the behavior is undefined. Otherwise, for every integer in, moves the element originally at position  to position. If meets the  requirements, then the moves are performed in decreasing order of  starting from.

@2,4@ Same as and, respectively, but executed according to  and the moves may be performed in any order.

Elements that are in the original range but not the new range are left in a valid but unspecified state.

Return value
@1-2@ The end of the resulting range. If is less than, returns. Otherwise, returns. @3-4@ The beginning of the resulting range. If is less than, returns. Otherwise, returns.

Complexity
@1-2@ At most assignments. @3-4@ At most assignment or swaps.