Chapter Overview
Explore how to create STL-compatible iterators including iterable ranges, reverse adapters, zip iterators, and generators. Understand iterator traits, sentinels, and random-access designs to effectively solve iterator-related problems.
We'll cover the following...
We'll cover the following...
As an introduction to iterators, let's proceed with the following recipes in this chapter:
- Create an iterable range
- Make our iterators compatible with STL iterator traits
- Use iterator adapters to fill STL containers
- Create a generator as iterators
- Use reverse iterator adapters to iterate backward
- Iterate objects of unknown length with a sentinel
- Build a zip iterator adapter
- Create a random-access iterator