The iterator type must be a model of .
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).
The value type of the iterator
The category of the iterator
i
is incrementable (not
off-the-end) and some dereferenceable iterator j
exists
such that i == ++j
Same as for predecrement
Equivalent to {Iter j = i; --i; return j;}
i
is dereferenceable or
off-the-end
All iterator operations must take amortized constant time.
&i = &(--i)
i == j
implies --i == --j
++i; --i;
and --i; ++i;
must end up with the
value of i
unmodified, if i
both of the
operations in the pair are valid.