##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# C++ concepts: Iterator

From cppreference.com
< cpp‎ | concept

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

- `CopyConstructible`
- `CopyAssignable`
- `Destructible`

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

- Iterator library

### [edit] Footnotes

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

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/concept/Iterator&oldid=42123"