boost::mpl::Trivial Iterator

# Trivial Iterator

### Description

A Trivial Iterator `i` is a type that represents a reference to an element of some Sequence, and allows to access the element through its nested `type` member [1]. A trivial iterator does not define any traversal operations.

### Definitions

- a trivial iterator can be dereferenceable, meaning that accessing its nested `type` member is a well-defined operation.

### Valid expressions

Expression | Expression type
--- | ---
`typename i::type` | A type

### Expression semantics

Expression | Complexity | Precondition | Semantics | Postcondition
--- | --- | --- | --- | ---
`typename i::type` | Amortized constant time | `i` is dereferenceable | `i::type` is identical to the type of the pointed element |

### Invariants

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

- `i` and `j` are identical if and only if they are pointing to the same element;
- if `i` is dereferenceable, and `j` is identical to `i`, then `j` is dereferenceable as well;
- if `i` and `j` are identical and dereferenceable, then `i::type` and `j::type` are identical.

### Notes

[1] Any trivial iterator is a model of [Nullary Metafunction Class] concept.

### See also

Sequence, Input Iterator

Table of Contents
Last edited July 15, 2002 10:46 am