The standard library defines five categories of iterators:
- Input iterators: These are the simplest category and guarantee validity only for single-pass sequential algorithms. After being incremented, the previous copies may become invalid.
- Output iterators: These are basically input iterators that can be used to write to the pointed element.
- Forward iterators: These can read (and write) data to the pointed element. They satisfy the requirements for input iterators and, in addition, must be default constructible and must support multi-pass scenarios without invalidating the previous copies.
- Bidirectional iterators: These are forward iterators that, in addition, support decrementing, so they can move in both directions.
- Random ...