2003-08-05 19:42:37 +00:00
|
|
|
::
|
|
|
|
|
|
|
|
template <
|
|
|
|
class Iterator
|
|
|
|
, class Value = use_default
|
2003-12-16 22:10:51 +00:00
|
|
|
, class CategoryOrTraversal = use_default
|
2003-08-05 19:42:37 +00:00
|
|
|
, class Reference = use_default
|
|
|
|
, class Difference = use_default
|
|
|
|
>
|
|
|
|
class indirect_iterator
|
2003-12-16 22:10:51 +00:00
|
|
|
: public iterator_adaptor<
|
|
|
|
indirect_iterator<Iterator, Value, Access, Traversal,
|
|
|
|
Reference, Difference>,
|
|
|
|
Iterator,
|
|
|
|
/* Value = see below */,
|
|
|
|
CategoryOrTraversal,
|
|
|
|
Reference,
|
|
|
|
Difference>
|
2003-08-05 19:42:37 +00:00
|
|
|
{
|
|
|
|
friend class iterator_core_access;
|
|
|
|
public:
|
|
|
|
indirect_iterator();
|
|
|
|
indirect_iterator(Iterator x);
|
2003-12-16 22:10:51 +00:00
|
|
|
|
2003-08-05 19:42:37 +00:00
|
|
|
template <
|
2003-12-16 22:10:51 +00:00
|
|
|
class Iterator2, class Value2, class Category2
|
2003-08-05 19:42:37 +00:00
|
|
|
, class Reference2, class Difference2
|
|
|
|
>
|
|
|
|
indirect_iterator(
|
|
|
|
indirect_iterator<
|
2003-12-16 22:10:51 +00:00
|
|
|
Iterator2, Value2, Category2, Reference2, Difference2
|
2003-08-05 19:42:37 +00:00
|
|
|
> const& y
|
|
|
|
, typename enable_if_convertible<Iterator2, Iterator>::type* = 0 // exposition
|
|
|
|
);
|
|
|
|
private: // as-if specification
|
|
|
|
typename indirect_iterator::reference dereference() const
|
|
|
|
{
|
|
|
|
return **this->base();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
``indirect_iterator`` requirements
|
|
|
|
..................................
|
|
|
|
|
2003-12-16 22:10:51 +00:00
|
|
|
The following requirements are placed on the type
|
|
|
|
``iterator_traits<Iterator>::value_type``. Let ``i`` be an object of
|
|
|
|
type ``iterator_traits<Iterator>::value_type``. Then ``*i`` must be a
|
|
|
|
valid expression, and the type of ``*i`` must be the same as the
|
|
|
|
``Reference`` template parameter.
|
|
|
|
|
|
|
|
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
|
2003-08-05 19:42:37 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
iterator_traits< iterator_traits<Iterator>::value_type >::value_type
|
|
|
|
|
|
|
|
If the default is used for ``Value``, then there must be a valid
|
|
|
|
specialization of ``iterator_traits`` for the value type of the base
|
|
|
|
iterator.
|
|
|
|
|
2003-12-16 22:10:51 +00:00
|
|
|
.. THE ABOVE IS NO LONGER IN SYNC WITH THE CODE. -Jeremy
|
2003-08-05 19:42:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
The indirect iterator will model the most refined standard traversal
|
2003-12-16 22:10:51 +00:00
|
|
|
concept that is modeled by the ``Iterator`` type and that refines the
|
|
|
|
traversal category specified in the ``CategoryOrTraversal`` parameter.
|
|
|
|
The indirect iterator will model the most refined standard access
|
|
|
|
concept that is modeled by the value type of ``Iterator``.
|
2003-08-05 19:42:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
``indirect_iterator`` operations
|
|
|
|
................................
|
|
|
|
|
|
|
|
``indirect_iterator();``
|
|
|
|
|
|
|
|
:Requires: ``Iterator`` must be Default Constructible.
|
2003-12-16 22:10:51 +00:00
|
|
|
:Returns: An instance of ``indirect_iterator`` with
|
|
|
|
a default-constructed ``iterator_adaptor`` subobject.
|
2003-08-05 19:42:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
``indirect_iterator(Iterator x);``
|
|
|
|
|
|
|
|
:Returns: An instance of ``indirect_iterator`` with
|
|
|
|
the ``iterator_adaptor`` subobject copy constructed from ``x``.
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
template <
|
2003-09-22 19:55:01 +00:00
|
|
|
class Iterator2, class Value2, unsigned Access, class Traversal
|
2003-08-05 19:42:37 +00:00
|
|
|
, class Reference2, class Difference2
|
|
|
|
>
|
|
|
|
indirect_iterator(
|
|
|
|
indirect_iterator<
|
2003-09-22 19:55:01 +00:00
|
|
|
Iterator2, Value2, Access, Traversal, Reference2, Difference2
|
2003-08-05 19:42:37 +00:00
|
|
|
> const& y
|
|
|
|
, typename enable_if_convertible<Iterator2, Iterator>::type* = 0 // exposition
|
|
|
|
);
|
|
|
|
|
|
|
|
:Requires: ``Iterator2`` is implicitly convertible to ``Iterator``.
|
2003-12-16 22:10:51 +00:00
|
|
|
:Returns: An instance of ``indirect_iterator`` whose
|
|
|
|
``iterator_adaptor`` subobject is constructed from ``y.base()``.
|
|
|
|
|
2003-08-05 19:42:37 +00:00
|
|
|
|