O'Reilly logo

Extended STL, Volume 1: Collections and Iterators by Matthew Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required