Predefined Iterator typedefs

Figure 15.8 shows the predefined iterator typedefs that are found in the Standard Library container class definitions. Not every typedef is defined for every container. We use const versions of the iterators for traversing const containers or non-const containers that should not be modified. We use reverse iterators to traverse containers in the reverse direction.

Image

Fig. 15.8. Iterator typedefs.

Image Error-Prevention Tip 15.3

Operations performed on a const_iterator return references to const to prevent modification to elements ...

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.