25 Algorithms library [algorithms]

25.3 Mutating sequence operations [alg.modifying.operations]

25.3.2 Move [alg.move]

template<class InputIterator, class OutputIterator> OutputIterator move(InputIterator first, InputIterator last, OutputIterator result);

Effects: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = std::move(*(first + n)).

Returns: result + (last - first).

Requires: result shall not be in the range [first,last).

Complexity: Exactly last - first move assignments.

template<class BidirectionalIterator1, class BidirectionalIterator2> BidirectionalIterator2 move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, BidirectionalIterator2 result);

Effects: Moves elements in the range [first,last) into the range [result - (last-first),result) starting from last - 1 and proceeding to first.271 For each positive integer n <= (last - first), performs *(result - n) = std::move(*(last - n)).

Requires: result shall not be in the range (first,last].

Returns: result - (last - first).

Complexity: Exactly last - first assignments.

move_backward should be used instead of move when last is in the range [result - (last - first),result).