Lecture overview -- Keyboard shortcut: 'u'  Previous page: Example uses of iterators - basis stuff -- Keyboard shortcut: 'p'  Next page: Categories of iterators -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 5 - Page 19 : 39
Notes about C++
Templates and The Standard Library
Different classifications of iterators

C++ iterators are classified in a number of different dimensions - not always completely orthogonal

Despite being heavily classified, the iterator types are not organized in a class hierarchy

  • The C++ Programming Language: Page 551, 553, 557, 561
 

  • Const and non-const iterators

    • A const iterator cannot be used for modification of the designated element

  • Checked and non-checked iterators

    • A checked iterator enforces range checking

  • Reverse and 'normal non-reverse' iterators

    • For a reverse iterator, ++ moves backward

  • Input, output, forward, bidirectional, random-access iterators

    • Input and output iterators have relative few operators defined

    • Random access iterators have many operators defined

    • Next slide