Some progress on indirect_iterator

[SVN r21710]
This commit is contained in:
Dave Abrahams
2004-01-13 23:03:18 +00:00
parent 736044938d
commit 0f8c236e9d
15 changed files with 524 additions and 127 deletions

View File

@ -66,52 +66,34 @@ following pseudo-code. We use the abbreviation
else
typedef Difference difference_type;
``iterator_category`` satisfies the following conditions, where
``R`` is ``reference`` and ``V`` is ``value_type``, and where: if
``CategoryOrTraversal`` is ``use_default``, ``C`` is
``iterator_traversal<Iterator>::type`` and otherwise ``C`` is
``CategoryOrTraversal``:
If ``CategoryOrTraversal`` is not ``use_default`` then
``iterator_category`` is ``CategoryOrTraversal``. Otherwise
``iterator_category`` is a type convertible to the tag determined by
the following algorithm. Let ``C`` be ``traversal_category<Iterator>::type``.
::
if (reference is a reference to value_type) then
if (C is convertible to random_access_traversal_tag) then
random_access_iterator_tag
else if (C is convertible to bidirectional_traversal_tag) then
bidirectional_iterator_tag
else
forward_iterator_tag
else
input_iterator_tag
.. include:: facade_iterator_category.rst
``indirect_iterator`` requirements
..................................
The ``Iterator`` argument shall meet the requirements of Readable
Iterator. The ``CategoryOrTraversal`` argument shall be one of the
standard iterator tags or ``use_default``. If ``CategoryOrTraversal``
is an iterator tag, the template parameter ``Iterator`` argument shall
meet the requirements corresponding to the iterator tag.
The expression ``*v``, where ``v`` is an object of type
``iterator_traits<Iterator>::value_type``, must be a valid expression
and must be convertible to ``indirect_iterator::reference``. Also
``indirect_iterator::reference`` must be convertible to
``indirect_iterator::value``. There are further requirements on the
``iterator_traits<Iterator>::value_type`` if the ``Value`` parameter
is not ``use_default``, as implied by the algorithm for deducing the
default for the ``value_type`` member.
``iterator_traits<Iterator>::value_type``, shall be valid
expression and convertible to ``reference``. [Note: there are
further requirements on the
``iterator_traits<Iterator>::value_type`` if the ``Value``
parameter is not ``use_default``, as implied by the algorithm for
deducing the default for the ``value_type`` member.]
``indirect_iterator`` models
............................
If ``CategoryOrTraversal`` is a standard iterator tag,
``indirect_iterator`` is a model of the iterator concept corresponding
to the tag, otherwise ``indirect_iterator`` satisfies the requirements
of the most refined standard traversal concept that is satisfied by
the ``Iterator`` argument.
``indirect_iterator`` is a model of the iterator concept
corresponding to the tag. Otherwise, ``indirect_iterator``
satisfies the requirements of the most refined standard traversal
concept that is satisfied by the ``Iterator`` argument.
``indirect_iterator`` models Readable Iterator. If
``indirect_iterator::reference(*v) = t`` is a valid expression (where