Chapter 36. Transform Iterator

 

The most common of all follies is to believe passionately in the palpably not true. It is the chief occupation of mankind.

 
 --Henry Louis Mencken
 

I reject your reality, and substitute my own!

 
 --Adam Savage

Introduction

This chapter, the first on the subject of iterator adaptors, describes a simple iterator adaptor that allows the apparent values and/or types of the elements in a range to be modified, via the iterator adaptor class template stlsoft::transform_iterator. It illustrates several of the issues associated with writing iterator adaptors, including determination of the adapted iterator category, support for different iterator category refinements, and the restrictions on selection of the supported reference ...

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.