The behavior of this function template is equivalent to:
| 1 2 3 4 5 6 7 |
|
Parameters
- first, last
- Forward iterators to the initial and final positions of the range to be copied 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.
Return value
An output iterator pointing to the end of the copied range.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Output:
myvector contains: 40 50 60 70 10 20 30 |
Complexity
Linear: Performs as many assignment operations as the length of range [first,last).See also
| rotate | Rotate elements in range (function template) |
| reverse_copy | Copy range reversed (function template) |
| random_shuffle | Rearrange elements in range randomly (function template) |
| copy | Copy range of elements (function template) |
