Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
Front Page / Iterators / Concepts / Forward Iterator

Forward Iterator

Description

A Forward Iterator i is a type that represents a positional reference to an element of a Forward Sequence. It allows to access the element through a dereference operation, and provides a way to obtain an iterator to the next element in a sequence.

Definitions

Expression requirements

Expression Type Complexity
deref<i>::type Any type Amortized constant time
next<i>::type Forward Iterator Amortized constant time
i::category Integral Constant, convertible to forward_iterator_tag Constant time

Expression semantics

typedef deref<i>::type j;
Precondition:i is dereferenceable
Semantics:j is identical to the type of the pointed element
typedef next<i>::type j;
Precondition:i is incrementable
Semantics:j is the next iterator in a sequence
Postcondition:j is dereferenceable or past-the-end
typedef i::category c;
Semantics:c is identical to the iterator's category tag

Invariants

For any forward iterators i and j the following invariants always hold:

See also

Iterators, Bidirectional Iterator, Forward Sequence, deref, next