Standard C++ Library
Copyright 1998, Rogue Wave Software, Inc.

## NAME

__Random_____Access_____Iterators__
- An iterator that reads, writes, and allows random access
to a container.

## DESCRIPTION

NOTE:
For a complete discussion of iterators, see the Iterators
section of this reference.
Iterators are a generalization of pointers that allow a C++
program to uniformly interact with different data struc-
tures. Random access iterators can read, write, and allow
random access to the containers they serve. These iterators
satisfy the requirements listed below.

## KEY TO ITERATOR REQUIREMENTS

The following key pertains to the iterator requirements
listed below:
__a__ __and__ __b__ values of type __X__
__n__ value of __distance__ type
__u__, __Distance__, __tmp__ __and__ __m__ identifiers
__r__ value of type __X__&
__t__ value of type __T__

## REQUIREMENTS FOR RANDOM ACCESS ITERATORS

The following expressions must be valid for random access
iterators:
__X__ __u__ __u__ might have a singular value
__X__() __X__() might be singular
__X__(__a__) copy constructor, __a__ == __X__(__a__)
__X__ __u__(__a__) copy constructor, __u__ == __a__
__X__ __u__ = __a__ assignment, __u__ == __a__
__a__ == __b__, __a__ != __b__ return value convertible to __bool__
__r__ = __a__ assignment, __r__ == __a__
*__a__ return value convertible to __T__&
__a__->__m__ equivalent to (*__a__).__m__
++__r__ returns __X__&
__r__++ return value convertible to const __X__&
*__r__++ returns __T__&
--__r__ returns __X__&
__r__-- return value convertible to const __X__&
*__r__-- returns __T__&
__r__ += __n__ Semantics of --__r__ or ++__r__ __n__ times depending on the
sign of __n__
__a__ + __n__, __n__ + __a__ returns type __X__
__r__ -= __n__ returns __X__&, behaves as __r__ += -__n__
__a__ - __n__ returns type __X__
__b__ - __a__ returns __distance__
__a__[__n__] *(__a__+__n__), return value convertible to __T__
__a__ < __b__ total ordering relation
__a__ > __b__ total ordering relation opposite to <
__a__ <= __b__ !(__a__ < __b__)
__a__ >= __b__ !(__a__ > __b__)
Like forward iterators, random access iterators have the
condition that __a__ == __b__ implies *__a__ == *__b__.
There are no restrictions on the number of passes an algo-
rithm may make through the structure.
All relational operators return a value convertible to __bool__.

## SEE ALSO

Iterators, Forward_Iterators, Bidirectional_Iterators