STL Iterator Categories

A key factor in the design of STL is the consistent use of iterators, which generalize C++ pointers, as intermediaries between algorithms and containers. An iterator is an object that allows access to and iteration through the elements in a container. A precise classification of iterators into five categories is the basis for determining which algorithms can be used with which containers, and is the main guide to extension of the library to include new algorithms that work with STL containers, or new containers to which many STL generic algorithms can be applied.

The scheme used to determine which algorithms and containers can be combined consists of three parts:

ITERATOR CATEGORIES

CATEGORY OF ITERATORS PROVIDED BY EACH STL CONTAINER TYPE


G. Andrus
Sun Jan 21 CDT 2001