mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-29 12:27:33 +02:00
Various fixups
[SVN r21669]
This commit is contained in:
@ -27,60 +27,56 @@
|
|||||||
|
|
||||||
|
|
||||||
If the ``Difference`` argument is ``use_default`` then the
|
If the ``Difference`` argument is ``use_default`` then the
|
||||||
``difference_type`` member is an implementation defined signed
|
``difference_type`` member is an unspecified signed integral
|
||||||
integral type. Otherwise ``difference_type`` is ``Difference``.
|
type. Otherwise ``difference_type`` is ``Difference``.
|
||||||
|
|
||||||
If ``CategoryOrTraversal`` is not ``use_default`` then the member
|
If ``CategoryOrTraversal`` is not ``use_default`` then the member
|
||||||
``iterator_category`` is ``CategoryOrTraversal``. Otherwise, if
|
``iterator_category`` is ``CategoryOrTraversal``. Otherwise, if
|
||||||
``Incrementable`` is a numeric type then ``iterator_category`` is a
|
``Incrementable`` is a numberic type ``iterator_category`` is a
|
||||||
type convertible to ``random_access_iterator_tag``. If
|
type convertible to ``random_access_iterator_tag``. Otherwise,
|
||||||
``Incrementable`` is not a numeric type then ``iterator_category`` is
|
``iterator_category`` is unspecified, and the ``counting_iterator``
|
||||||
``iterator_traversal<Incrementable>::type``.
|
specialization models the same iterator traversal concepts modeled
|
||||||
|
by ``Incrementable``.
|
||||||
|
|
||||||
[*Note:* implementers are encouraged to provide an implementation of
|
[*Note:* implementers are encouraged to provide an implementation of
|
||||||
``operator-`` and a ``difference_type`` that avoids overflows in
|
``operator-`` and a ``difference_type`` that avoid overflows in
|
||||||
the cases when the ``Incrementable`` type is a numeric type.]
|
the cases when the ``Incrementable`` type is a numeric type.]
|
||||||
|
|
||||||
|
|
||||||
``counting_iterator`` requirements
|
``counting_iterator`` requirements
|
||||||
..................................
|
..................................
|
||||||
|
|
||||||
The ``Incrementable`` type must be Default Constructible, Copy
|
``Incrementable`` must be Default Constructible, Copy
|
||||||
Constructible, and Assignable.
|
Constructible, and Assignable.
|
||||||
|
|
||||||
If ``iterator_category`` is convertible to ``forward_iterator_tag`` or
|
If ``iterator_category`` is convertible to ``forward_iterator_tag``
|
||||||
``forward_traversal_tag`` then the following expressions must be valid::
|
or ``forward_traversal_tag``, the following must be well-formed::
|
||||||
|
|
||||||
Incrementable i, j;
|
Incrementable i, j;
|
||||||
++i // pre-increment
|
++i; // pre-increment
|
||||||
i == j // operator equal
|
i == j; // operator equal
|
||||||
|
|
||||||
|
|
||||||
If ``iterator_category`` is convertible to
|
If ``iterator_category`` is convertible to
|
||||||
``bidirectional_iterator_tag`` or ``bidirectional_traversal_tag`` then
|
``bidirectional_iterator_tag`` or ``bidirectional_traversal_tag``,
|
||||||
pre-decrement is required::
|
the following expression must also be well-formed::
|
||||||
|
|
||||||
--i
|
--i
|
||||||
|
|
||||||
If ``iterator_category`` is convertible to
|
If ``iterator_category`` is convertible to
|
||||||
``random_access_iterator_tag`` or ``random_access_traversal_tag`` then
|
``random_access_iterator_tag`` or ``random_access_traversal_tag``,
|
||||||
these additional expressions are also required::
|
the following must must also be valid::
|
||||||
|
|
||||||
counting_iterator::difference_type n;
|
counting_iterator::difference_type n;
|
||||||
i += n
|
i += n;
|
||||||
n = i - j
|
n = i - j;
|
||||||
i < j
|
i < j;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
``counting_iterator`` models
|
``counting_iterator`` models
|
||||||
............................
|
............................
|
||||||
|
|
||||||
``counting_iterator`` models Readable Lvalue Iterator. In addition,
|
Specializations of ``counting_iterator`` model Readable Lvalue
|
||||||
``counting_iterator`` models the concepts corresponding to the
|
Iterator. In addition, they model the concepts corresponding to the
|
||||||
iterator tags that ``counting_iterator::iterator_category`` is
|
iterator tags to which their ``iterator_category`` is convertible.
|
||||||
convertible to.
|
|
||||||
|
|
||||||
|
|
||||||
``counting_iterator`` operations
|
``counting_iterator`` operations
|
||||||
|
Reference in New Issue
Block a user