Part Three. Iterators

This part of the book covers two main topics: output iterators (Section 1.3.2) and iterator adaptors.

The first chapter in this part, Chapter 34, looks at an enhancement to std::ostream_iterator that provides for prefixes along with suffixes and is completely backward-compatible. This is then immediately followed by an intermezzo, Chapter 35, in which a common strategy for implementing output iterators is shown to result in fatuous code, and a new pattern that can be readily applied to avoid such code is described.

Next, Chapter 36 presents our first case of iterator adaptation, that of transforming the values and/or type of the elements in a range. It demonstrates that a transforming iterator must bear the by-value temporary ...

Get Extended STL, Volume 1: Collections and Iterators 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.