std::rotate_copy

Copies the elements in the range [first,last) to the range beginning at result, but rotating the order of the elements in such a way that the element pointed by middle becomes the first element in the resulting range.

Parameters

first, last

Forward iterators to the initial and final positions of the range to be copy-rotated. The range used is [first,last), which contains all the elements between first and last, including the element pointed by first but not the element pointed by last.
Notice that in this function, these are not consecutive parameters, but the first and third ones.

middle

Forward iterator pointing to the element within the range [first,last) that is copied as the first element in the resulting range.

result

Output iterator to the initial position of the range where the reversed range is stored.
The pointed type shall support being assigned the value of an element in the range [first,last).