forked from boostorg/iterator
some edits
[SVN r21293]
This commit is contained in:
@ -3,25 +3,32 @@
|
|||||||
template <
|
template <
|
||||||
class Iterator
|
class Iterator
|
||||||
, class Value = use_default
|
, class Value = use_default
|
||||||
, unsigned Access = use_default_access
|
, class CategoryOrTraversal = use_default
|
||||||
, class Traversal = use_default
|
|
||||||
, class Reference = use_default
|
, class Reference = use_default
|
||||||
, class Difference = use_default
|
, class Difference = use_default
|
||||||
>
|
>
|
||||||
class indirect_iterator
|
class indirect_iterator
|
||||||
: public iterator_adaptor</* see discussion */>
|
: public iterator_adaptor<
|
||||||
|
indirect_iterator<Iterator, Value, Access, Traversal,
|
||||||
|
Reference, Difference>,
|
||||||
|
Iterator,
|
||||||
|
/* Value = see below */,
|
||||||
|
CategoryOrTraversal,
|
||||||
|
Reference,
|
||||||
|
Difference>
|
||||||
{
|
{
|
||||||
friend class iterator_core_access;
|
friend class iterator_core_access;
|
||||||
public:
|
public:
|
||||||
indirect_iterator();
|
indirect_iterator();
|
||||||
indirect_iterator(Iterator x);
|
indirect_iterator(Iterator x);
|
||||||
|
|
||||||
template <
|
template <
|
||||||
class Iterator2, class Value2, unsigned Access2, class Traversal2
|
class Iterator2, class Value2, class Category2
|
||||||
, class Reference2, class Difference2
|
, class Reference2, class Difference2
|
||||||
>
|
>
|
||||||
indirect_iterator(
|
indirect_iterator(
|
||||||
indirect_iterator<
|
indirect_iterator<
|
||||||
Iterator2, Value2, Access2, Traversal2, Reference2, Difference2
|
Iterator2, Value2, Category2, Reference2, Difference2
|
||||||
> const& y
|
> const& y
|
||||||
, typename enable_if_convertible<Iterator2, Iterator>::type* = 0 // exposition
|
, typename enable_if_convertible<Iterator2, Iterator>::type* = 0 // exposition
|
||||||
);
|
);
|
||||||
@ -35,13 +42,16 @@
|
|||||||
``indirect_iterator`` requirements
|
``indirect_iterator`` requirements
|
||||||
..................................
|
..................................
|
||||||
|
|
||||||
The ``value_type`` of the ``Iterator`` template parameter should
|
The following requirements are placed on the type
|
||||||
itself be dereferenceable. The return type of the ``operator*`` for
|
``iterator_traits<Iterator>::value_type``. Let ``i`` be an object of
|
||||||
the ``value_type`` must be the same type as the ``Reference`` template
|
type ``iterator_traits<Iterator>::value_type``. Then ``*i`` must be a
|
||||||
parameter. The ``Value`` template parameter will be the ``value_type``
|
valid expression, and the type of ``*i`` must be the same as the
|
||||||
for the ``indirect_iterator``, unless ``Value`` is const. If ``Value``
|
``Reference`` template parameter.
|
||||||
is ``const X``, then ``value_type`` will be *non-* ``const X``. The
|
|
||||||
default for ``Value`` is
|
The ``Value`` template parameter will be the ``value_type`` for the
|
||||||
|
``indirect_iterator``, unless ``Value`` is cv-qualified. If ``Value``
|
||||||
|
is cv-qualified then ``value_type`` will be non-qualified version of
|
||||||
|
the type. The default for ``Value`` is
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@ -51,18 +61,14 @@ If the default is used for ``Value``, then there must be a valid
|
|||||||
specialization of ``iterator_traits`` for the value type of the base
|
specialization of ``iterator_traits`` for the value type of the base
|
||||||
iterator.
|
iterator.
|
||||||
|
|
||||||
The ``Reference`` parameter will be the ``reference`` type of the
|
.. THE ABOVE IS NO LONGER IN SYNC WITH THE CODE. -Jeremy
|
||||||
``indirect_iterator``. The default is ``Value&``.
|
|
||||||
|
|
||||||
The ``Access`` and ``Traversal`` parameters are passed unchanged to
|
|
||||||
the corresponding parameters of the ``iterator_adaptor`` base
|
|
||||||
class, and the ``Iterator`` parameter is passed unchanged as the
|
|
||||||
``Base`` parameter to the ``iterator_adaptor`` base class.
|
|
||||||
|
|
||||||
The indirect iterator will model the most refined standard traversal
|
The indirect iterator will model the most refined standard traversal
|
||||||
concept that is modeled by the ``Iterator`` type. The indirect
|
concept that is modeled by the ``Iterator`` type and that refines the
|
||||||
iterator will model the most refined standard access concept that is
|
traversal category specified in the ``CategoryOrTraversal`` parameter.
|
||||||
modeled by the value type of ``Iterator``.
|
The indirect iterator will model the most refined standard access
|
||||||
|
concept that is modeled by the value type of ``Iterator``.
|
||||||
|
|
||||||
|
|
||||||
``indirect_iterator`` operations
|
``indirect_iterator`` operations
|
||||||
@ -71,8 +77,8 @@ modeled by the value type of ``Iterator``.
|
|||||||
``indirect_iterator();``
|
``indirect_iterator();``
|
||||||
|
|
||||||
:Requires: ``Iterator`` must be Default Constructible.
|
:Requires: ``Iterator`` must be Default Constructible.
|
||||||
:Returns: An instance of ``indirect_iterator`` with
|
:Returns: An instance of ``indirect_iterator`` with
|
||||||
a default constructed base object.
|
a default-constructed ``iterator_adaptor`` subobject.
|
||||||
|
|
||||||
|
|
||||||
``indirect_iterator(Iterator x);``
|
``indirect_iterator(Iterator x);``
|
||||||
@ -94,5 +100,7 @@ modeled by the value type of ``Iterator``.
|
|||||||
);
|
);
|
||||||
|
|
||||||
:Requires: ``Iterator2`` is implicitly convertible to ``Iterator``.
|
:Requires: ``Iterator2`` is implicitly convertible to ``Iterator``.
|
||||||
:Returns: An instance of ``indirect_iterator`` that is a copy of ``y``.
|
:Returns: An instance of ``indirect_iterator`` whose
|
||||||
|
``iterator_adaptor`` subobject is constructed from ``y.base()``.
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user