copy_backward or copy with reverse_iterators?

c++, stl

Solution

First of all, use of copy_backward() clearly shows developer's intention to copy interval in reverse order.

copy_backward() works with original bidirectional iterators, while the reverse_iterator is an adaptor of a bidirectional iterator and may be not as effective as original iterator.

Using the reverse_iterator makes sense when you need to apply an algorithm for input iterators like copy() to reverse sequence, but don't have counterpart for bidirectional operators like copy_backward().

Therefore, there are conceptual and practical differences.

Problem

In terms of practical usage what differences are there between a) copy_backward b) copy with reverse_iterators for source and destination In particular is one more generally applicable than the other? Are there any other differences? Update: If there's really no difference, then any reference in C++ literature to this equivalence is appreciated. The motivation behind this question is to understand if this was by design or one of those slip ups (like missing copy_if)

Original source