Changing Items

The reverse function acts on a range in a container and reverses the order of the items; this means that the iterators must be writeable. The copy and copy_n functions copy every item from one range to another in a forward direction; for copy, the input range is given by two input iterators, and for copy_n, the range is an input iterator and a count of items. The copy_backward function will copy the items, starting at the end of the range, so that the output range will have the items in the same order as the original. This means that the output iterator will indicate the end of the range to copy to. You can also copy items only if they satisfy some condition specified by a predicate.

  • The reverse_copy function will create a ...

Get Beginning C++ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.