Back to Arangodb

Random Access Iterator

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/random-access-iterator.html

3.12.9.13.0 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Iterators / Concepts / Random Access Iterator |

Random Access Iterator

Description

A Random Access Iterator is a Bidirectional Iterator that provides constant-time guarantees on moving the iterator an arbitrary number of positions forward or backward and for measuring the distance to another iterator in the same sequence.

Refinement of

Bidirectional Iterator

Expression requirements

In addition to the requirements defined in Bidirectional Iterator, the following requirements must be met.

ExpressionTypeComplexity
next<i>::typeRandom Access IteratorAmortized constant time
prior<i>::typeRandom Access IteratorAmortized constant time
i::categoryIntegral Constant, convertible to random_access_iterator_tagConstant time
advance<i,n>::typeRandom Access IteratorAmortized constant time
distance<i,j>::typeIntegral ConstantAmortized constant time

Expression semantics

typedef[advance](./advance.html)<i,n>::type j;

| Semantics: | See advance specification |

typedef[distance](./distance.html)<i,j>::type n;

| Semantics: | See distance specification |

Invariants

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

See also

Iterators, Bidirectional Iterator, Random Access Sequence, advance, distance

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |