Namespaces
Variants
Views
Actions

C++ concepts: Iterator

From cppreference.com
< cpp‎ | concept
Revision as of 15:10, 2 November 2012 by P12bot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Iterator concept describes types that can be used to identify and traverse the elements of a container.

Iterator is the base concept used by other iterator types: InputIterator, OutputIterator, ForwardIterator, BidirectionalIterator, and RandomAccessIterator. Iterators can be thought of as an abstraction of pointers.

[edit] Requirements

For type It to be an Iterator, in addition to the other requirements, the following conditions have to be satisfied for an object i of such type:

Expression Return Precondition
*i reference[1] i is dereferenceable [2]
++i It&

[edit] See also

[edit] Footnotes

  1. As defined in iterator_traits
  2. It's a valid iterator pointing to an existing element