more edits

[SVN r21307]
This commit is contained in:
Jeremy Siek
2003-12-17 19:32:31 +00:00
parent 84f22cde8d
commit 44d7dfeb9b
2 changed files with 66 additions and 41 deletions

View File

@ -1286,31 +1286,45 @@ private: // as-if specification
return **this->base();
}
};
template <class Dereferenceable>
struct referent {
typedef /* see below */ type;
};
</pre>
<p>If <tt class="literal"><span class="pre">Value</span></tt> is not <tt class="literal"><span class="pre">use_default</span></tt> then the the argument for the
<tt class="literal"><span class="pre">iterator_adaptor</span></tt> base class' <tt class="literal"><span class="pre">Value</span></tt> parameter is <tt class="literal"><span class="pre">Value</span></tt> with
cv-qualifiers removed. If <tt class="literal"><span class="pre">Value</span></tt> is <tt class="literal"><span class="pre">use_default</span></tt>, then the
argument for the <tt class="literal"><span class="pre">iterator_adaptor</span></tt> base class' <tt class="literal"><span class="pre">Value</span></tt> parameter
is computed as follows. We use the abbreviation
<tt class="literal"><span class="pre">V=iterator_traits&lt;Iterator&gt;::value_type</span></tt> and <tt class="literal"><span class="pre">v</span></tt> is an object of
type <tt class="literal"><span class="pre">V</span></tt>.:</p>
<pre class="literal-block">
if (*v returns a constant lvalue or an rvalue) then
referent&lt;V&gt;::type
else
add_const&lt;referent&lt;V&gt;::type&gt;::type
</pre>
<p>The algorithm for the <tt class="literal"><span class="pre">type</span></tt> member of <tt class="literal"><span class="pre">referent</span></tt> traits class is
as follows:</p>
<pre class="literal-block">
if (Dereferenceable is a class and has member element_type)
Dereferenceable::element_type
else
iterator_traits&lt;Dereferenceable&gt;::value_type
</pre>
</div>
<div class="section" id="indirect-iterator-requirements">
<h4><a class="toc-backref" href="#id42" name="indirect-iterator-requirements"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></h4>
<p>The following requirements are placed on the type
<p>The <tt class="literal"><span class="pre">Iterator</span></tt> type must meet the requirements of Readable
Iterator. Also, the following requirements are placed on
<tt class="literal"><span class="pre">iterator_traits&lt;Iterator&gt;::value_type</span></tt>. Let <tt class="literal"><span class="pre">i</span></tt> be an object of
type <tt class="literal"><span class="pre">iterator_traits&lt;Iterator&gt;::value_type</span></tt>. Then <tt class="literal"><span class="pre">*i</span></tt> must be a
valid expression, and the type of <tt class="literal"><span class="pre">*i</span></tt> must be the same as the
<tt class="literal"><span class="pre">Reference</span></tt> template parameter.</p>
<p>The <tt class="literal"><span class="pre">Value</span></tt> template parameter will be the <tt class="literal"><span class="pre">value_type</span></tt> for the
<tt class="literal"><span class="pre">indirect_iterator</span></tt>, unless <tt class="literal"><span class="pre">Value</span></tt> is cv-qualified. If <tt class="literal"><span class="pre">Value</span></tt>
is cv-qualified then <tt class="literal"><span class="pre">value_type</span></tt> will be non-qualified version of
the type. The default for <tt class="literal"><span class="pre">Value</span></tt> is</p>
<pre class="literal-block">
iterator_traits&lt; iterator_traits&lt;Iterator&gt;::value_type &gt;::value_type
</pre>
<p>If the default is used for <tt class="literal"><span class="pre">Value</span></tt>, then there must be a valid
specialization of <tt class="literal"><span class="pre">iterator_traits</span></tt> for the value type of the base
iterator.</p>
<!-- THE ABOVE IS NO LONGER IN SYNC WITH THE CODE. -Jeremy -->
<p>The indirect iterator will model the most refined standard traversal
concept that is modeled by the <tt class="literal"><span class="pre">Iterator</span></tt> type and that refines the
traversal category specified in the <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> parameter.
The indirect iterator will model the most refined standard access
concept that is modeled by the value type of <tt class="literal"><span class="pre">Iterator</span></tt>.</p>
<tt class="literal"><span class="pre">iterator_adaptor::reference</span></tt>. Also, there are further requirements
on the <tt class="literal"><span class="pre">iterator_traits&lt;Iterator&gt;::value_type</span></tt> if the <tt class="literal"><span class="pre">Value</span></tt>
parameter is not <tt class="literal"><span class="pre">use_default</span></tt>, as implied by the algorithm for deducing
the default.</p>
</div>
<div class="section" id="indirect-iterator-operations">
<h4><a class="toc-backref" href="#id43" name="indirect-iterator-operations"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></h4>

View File

@ -39,36 +39,47 @@
}
};
template <class Dereferenceable>
struct referent {
typedef /* see below */ type;
};
If ``Value`` is not ``use_default`` then the the argument for the
``iterator_adaptor`` base class' ``Value`` parameter is ``Value`` with
cv-qualifiers removed. If ``Value`` is ``use_default``, then the
argument for the ``iterator_adaptor`` base class' ``Value`` parameter
is computed as follows. We use the abbreviation
``V=iterator_traits<Iterator>::value_type`` and ``v`` is an object of
type ``V``.::
if (*v returns a constant lvalue or an rvalue) then
referent<V>::type
else
add_const<referent<V>::type>::type
The algorithm for the ``type`` member of ``referent`` traits class is
as follows::
if (Dereferenceable is a class and has member element_type)
Dereferenceable::element_type
else
iterator_traits<Dereferenceable>::value_type
``indirect_iterator`` requirements
..................................
The following requirements are placed on the type
The ``Iterator`` type must meet the requirements of Readable
Iterator. Also, the following requirements are placed on
``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.
``iterator_adaptor::reference``. Also, 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.
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
::
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.
.. THE ABOVE IS NO LONGER IN SYNC WITH THE CODE. -Jeremy
The indirect iterator will model the most refined standard traversal
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``.
``indirect_iterator`` operations