This base class only provides some member types, which in fact are not required to be present in any iterator type (iterator types have no specific member requirements), but they might be useful, since they define the members needed for the default iterator_traits class template to generate the appropriate iterator_traits class automatically.
It is defined as:
| 1 2 3 4 5 6 7 8 9 |
|
Template parameters
- Category
- Category to which the iterator belongs to. It must be one of the following iterator tags:
iterator tag Category of iterators input_iterator_tag Input Iterator output_iterator_tag Output Iterator forward_iterator_tag Forward Iterator bidirectional_iterator_tag Bidirectional Iterator random_access_iterator_tag Random Access Iterator - T
- Type of elements pointed by the iterator.
- Distance
- Type to represent the difference between two iterators.
- Pointer
- Type to represent a pointer to an element pointed by the iterator.
- Reference
- Type to represent a reference to an element pointed by the iterator.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Output
10 20 30 40 50 |
See also
| iterator | Iterator definitions (header) |
