0Pricing
C++ Academy · Lesson

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

  1. Iterator Categories input forward bidirectional random
  2. Common Iterator Patterns begin end advance
  3. C++20 Ranges Library Introduction
  4. Range Adaptors views::filter transform take
← Back to C++ Academy