Random Access Range

| Home | Libraries | People | FAQ | More

### Random Access Range

##### Description

A range `X` where `boost::range_iterator<X>::type` is a model of Random Access Traversal Iterator.

##### Refinement of

Bidirectional Range

##### Valid expressions

Name | Expression | Return type
--- | --- | ---
Size of range | `boost::size(a)` | `boost::range_size<X>::type`

##### Expression semantics

Expression | Semantics | Postcondition
--- | --- | ---
`boost::size(a)` | Returns the size of the Range, that is, its number of elements. Note `boost::size(a) == 0u` is equivalent to `boost::empty(a)`. | `boost::size(a) >= 0`

##### Complexity guarantees

`boost::size(a)` completes in amortized constant time.

##### Invariants

Range size | `boost::size(a)` is equal to the `boost::end(a)` - `boost::begin(a)`.