Share via


reverse_copy

reverse_copy

template<class BidIt, class OutIt>
    OutIt reverse_copy(BidIt first, BidIt last, OutIt x);

The template function evaluates *(x + N) = *(last - 1 - N) once for each N in the range [0, last - first). It then returns x + (last - first). Thus, the function reverses the order of elements in the sequence that it copies.

If x and first designate regions of storage, the range [x, x + (last - first)) must not overlap the range [first, last).

See the related sample program.