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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Bidirectional Iterator

Description

A Bidirectional Iterator traverses a Sequence allowing movement in either direction one element at a time.

Notation

i

A Bidirectional Iterator

I

A Bidirectional Iterator type

M

An MPL integral constant

N

An integral constant

Refinement of

Forward Iterator

Expression requirements

In addition to the requirements defined in Forward Iterator, the following expressions must be valid:

Expression

Return type

Runtime Complexity

next(i)

Bidirectional Iterator

Constant

prior(i)

Bidirectional Iterator

Constant

advance_c<N>(i)

Bidirectional Iterator

Constant

advance<M>(i)

Bidirectional Iterator

Constant

Meta Expressions

Expression

Compile Time Complexity

result_of::prior<I>::type

Amortized constant time

Expression Semantics

The semantics of an expression are defined only where they differ from, or are not defined in Forward Iterator

Expression

Semantics

prior(i)

An iterator to the element preceding i

Invariants

In addition to the invariants of Forward Iterator, the following invariants always hold:

Models

PrevUpHomeNext