Namespaces
Variants
Views
Actions

C++ concepts: Iterator

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

 
 
 

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.

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&

See also

Footnotes

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