First page Back Continue Last page Graphics
STL Iterators
- An object that can “iterate” over elements. May be all or part of a STL container.
- An iterator represents a certain position in a container.
- Operator *
- Returns the element of the actual position.
- Operator ++
- Lets the iterator step forward to the next element.
- Most iterators also allow stepping backwards by using operator - -
- Operator == and !=
- Returns whether two iterators represent the same position.
- Operator =
- Assigns an iterator (the position of the element to which it refers)