removed referent, use iterator_traits for smart pointers too

[SVN r21481]
This commit is contained in:
Jeremy Siek
2004-01-04 18:17:32 +00:00
parent a7edd713d8
commit f96a2b3d81

View File

@ -31,41 +31,23 @@
); );
}; };
template <class Dereferenceable>
struct referent {
/* see below */
};
The member types of ``indirect_iterator`` are defined according to the The member types of ``indirect_iterator`` are defined according to the
following pseudo-code. We use the abbreviation following pseudo-code. We use the abbreviation
``V=iterator_traits<Iterator>::value_type`` and ``v`` is an object of ``V=iterator_traits<Iterator>::value_type``.::
type ``V``.::
if (Value is use_default) then if (Value is use_default) then
if (referent<V> has member type) then
typedef remove_const<referent<V>::type> value_type;
else
typedef iterator_traits<V>::value_type value_type; typedef iterator_traits<V>::value_type value_type;
else else
typedef remove_const<Value>::type value_type; typedef remove_const<Value>::type value_type;
if (Reference is use_default) then if (Reference is use_default) then
if (Value is use_default) then typedef iterator_traits<V>::reference reference;
if (referent<V> has member type) then
typedef referent<V>::type& reference;
else
typedef iterator_traits<V>::value_type& reference;
else
typedef Value& reference;
else else
typedef Reference reference; typedef Reference reference;
if (Value is use_default) then if (Value is use_default) then
if (referent<V> has member type) then typedef iterator_traits<V>::pointer pointer;
typedef referent<V>::type* pointer;
else
typedef iterator_traits<V>::value_type* pointer;
else else
typedef Value* pointer; typedef Value* pointer;
@ -77,40 +59,44 @@ type ``V``.::
The member ``indirect_iterator::iterator_category`` is a type that The member ``indirect_iterator::iterator_category`` is a type that
satisfies the requirements of the concepts modeled by the indirect satisfies the requirements of the concepts modeled by the indirect
iterator as specified in the following requirements section. iterator as specified in the models section.
(Should replace this with detailed description. -JGS)
If the ``Dereferenceable`` template argument to ``referent`` is a
class and has member ``element_type`` then ``referent``
contains the following typedef::
typedef Dereferenceable::element_type type;
``indirect_iterator`` requirements ``indirect_iterator`` requirements
.................................. ..................................
The ``CategoryOrTraversal`` argument shall be one of the standard The ``Iterator`` argument shall meet the requirements of Readable
iterator tags or ``use_default``. If ``CategoryOrTraversal`` is an Iterator. The ``CategoryOrTraversal`` argument shall be one of the
iterator tag, the template parameter ``Iterator`` argument shall meet standard iterator tags or ``use_default``. If ``CategoryOrTraversal``
the traversal requirements corresponding to the iterator tag and the is an iterator tag, the template parameter ``Iterator`` argument shall
requirements of Readable Iterator and ``indirect_iterator`` satisfies meet the traversal requirements corresponding to the iterator tag.
the requirements corresponding to the iterator tag. If
``CategoryOrTraversal`` is ``use_default`` then the ``Iterator``
argument shall meet the requirements of Readable Iterator and
``indirect_iterator`` satisfies the requirements of the most refined
standard traversal concept that is satisfied by the ``Iterator``
argument. In this case
The expression ``*v``, where ``v`` is an object of type The expression ``*v``, where ``v`` is an object of type
``iterator_traits<Iterator>::value_type``, must be a valid expression ``iterator_traits<Iterator>::value_type``, must be a valid expression
and must be convertible to ``iterator_adaptor::reference``. Also, and must be convertible to ``indirect_iterator::reference``. Also
there are further requirements on the ``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 ``iterator_traits<Iterator>::value_type`` if the ``Value`` parameter
is not ``use_default``, as implied by the algorithm for deducing the is not ``use_default``, as implied by the algorithm for deducing the
default for the ``value_type`` member. 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`` models Readable Iterator. If
``indirect_iterator::reference(*v) = t`` is a valid expression (where
``t`` is an object of type ``indirect_iterator::value_type``) then
``indirect_iterator`` models Writable Iterator. If
``indirect_iterator::reference`` is a reference then
``indirect_iterator`` models Lvalue Iterator.
``indirect_iterator`` operations ``indirect_iterator`` operations
................................ ................................