copy_backward function template — Copies a range, starting at the end
template<typename BidiIter1, typename BidiIter2>
BidiIter2 copy_backward(BidiIter1 first, BidiIter1 last, BidiIter2 result);
The copy_backward
function
template does the same thing as copy
, but it works backward, starting at
the element before last
and
copying elements toward first
.
The result
iterator must point to
one past the end of the destination and is decremented before
copying each element. The return value is an iterator that points to
the first element of the destination, as shown in Figure 13-3.
The result
iterator cannot
be in the source range [first
,
last
), but other parts of the
destination range can overlap with the source.