C++ concepts: Iterator
From cppreference.com
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
- ↑ As defined in iterator_traits
- ↑ It's a valid iterator pointing to an existing element