std::move_backward

From Cppreference

Jump to: navigation, search
Defined in header <algorithm>

template< class BidirectionalIterator1, class BidirectionalIterator2 >

BidirectionalIterator2 move_backward( BidirectionalIterator1 first,
                                      BidirectionalIterator1 last,

                                      BidirectionalIterator2 d_last );

Moves the elements from the range [first, last), to another range ending at d_last. The elements are moved in reverse order (the last element is moved first), but their relative order is preserved.

Contents

[edit] Parameters

first, last - the range of the elements to move
d_last - end of the destination range. If d_last is within [first, last), std::move must be used instead of std::move_backward.

[edit] Return value

Iterator in the destination range, pointing at the last element moved.

[edit] Complexity

Exactly last - first move assignments.

[edit] Equivalent function

[edit] Example

[edit] See also

move (C++11)
moves a range of elements to a new location
(function template)