10.4. Revisiting Iterators

In addition to the iterators that are defined for each of the containers, the library defines several additional kinds of iterators in the iterator header. These iterators include

Insert iterators: These iterators are bound to a container and can be used to insert elements into the container.

Stream iterators: These iterators are bound to input or output streams and can be used to iterate through the associated IO stream.

Reverse iterators: These iterators move backward, rather than forward. The library containers, other than forward_list, have reverse iterators.

Move iterators: These special-purpose iterators move rather than copy their elements. We’ll cover move iterators in § 13.6.2 (p. 543).

Get C++ Primer, Fifth Edition 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.