Namespaces
Variants
Views
Actions

C++ concepts: BidirectionalIterator

From cppreference.com
< cpp‎ | concept
Revision as of 08:51, 14 May 2014 by D41D8CD98F (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A BidirectionalIterator is a ForwardIterator that can be moved in both directions (i.e. incremented and decremented).

[edit] Requirements

In addition to the above requirement, for a type It to be an BidirectionalIterator, an instance i of It must:

Expression Return Equivalent expression Notes
--i It& After this, copies of i are still valid
i-- convertible to const It& It temp = i;

--i;

return temp;
*i-- reference

A mutable BidirectionalIterator is a BidirectionalIterator that additionally satisfies the OutputIterator requirements.

[edit] See also