Iterator Categories input forward bidirectional random
Tell the iterator categories apart and pick algorithms that fit them.
What is an Iterator?
An iterator is a generalized pointer. Algorithms work through iterators, decoupling them from the underlying container.
Five Iterator Categories
Iterators are classified by capability:
- Input — read-only, single pass
- Output — write-only, single pass
- Forward — read/write, multi pass
- Bidirectional — can move forward and backward
- Random Access — can jump by an integer offset
All lessons in this course
- Iterator Categories input forward bidirectional random
- Common Iterator Patterns begin end advance
- C++20 Ranges Library Introduction
- Range Adaptors views::filter transform take