...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
BidirectionalIterator
A bidirectional iterator is an iterator that can read through a sequence of values. It can move in either direction through the sequence, and can be either mutable (data pointed to by it can be changed) or not mutable.
An iterator represents a position in a sequence. Therefore, the iterator can point into the sequence (returning a value when dereferenced and being incrementable), or be off-the-end (and not dereferenceable or incrementable).
value_type
std::iterator_traits<Iter>::value_type
The value type of the iterator
category
std::iterator_traits<Iter>::iterator_category
The category of the iterator
i
, j
x
Name | Expression | Type | Precondition | Semantics | Postcondition |
---|---|---|---|---|---|
Predecrement |
--i |
Iter & |
|
||
Postdecrement |
i-- |
Iter |
Same as for predecrement |
Equivalent to |
|