<<< Kinds of iterators | Index | Advice >>> |
Iterators are a widely used abstraction in the STL
The idea is to have something that can be used with
arrays, strings, lists, and even trees.
Combined with liberal typedefing, it is possible to switch representations with a minimum of other changes:
class Container { typedef std::vector< int > StorageType; typedef StorageType::const_iterator ConstStorageIter; typedef StorageType::iterator StorageIter; StorageType m_buffer; //... };
<<< Kinds of iterators | Index | Advice >>> |