more work on the specification of iterator_category

[SVN r21662]
This commit is contained in:
Jeremy Siek
2004-01-13 05:56:29 +00:00
parent 2edb688882
commit ec8d069057
9 changed files with 157 additions and 49 deletions

View File

@ -90,10 +90,21 @@ private:
</pre>
<p>The <tt class="literal"><span class="pre">reference</span></tt> type of <tt class="literal"><span class="pre">transform_iterator</span></tt> is
<tt class="literal"><span class="pre">result_of&lt;UnaryFunction(iterator_traits&lt;Iterator&gt;::reference)&gt;::type</span></tt>.
The <tt class="literal"><span class="pre">value_type</span></tt> is <tt class="literal"><span class="pre">remove_cv&lt;remove_reference&lt;reference&gt;</span> <span class="pre">&gt;::type</span></tt>.
The <tt class="literal"><span class="pre">iterator_category</span></tt> member is a type convertible to the tags
corresponding to each standard concept modeled by
<tt class="literal"><span class="pre">transform_iterator</span></tt>, as described in the models section.</p>
The <tt class="literal"><span class="pre">value_type</span></tt> is <tt class="literal"><span class="pre">remove_cv&lt;remove_reference&lt;reference&gt;</span> <span class="pre">&gt;::type</span></tt>.</p>
<p>The <tt class="literal"><span class="pre">iterator_category</span></tt> member is a type convertible to the iterator
tag given by the following algorithm. Let <tt class="literal"><span class="pre">C</span></tt> be
<tt class="literal"><span class="pre">traveral_category&lt;Iterator&gt;::type</span></tt>.</p>
<pre class="literal-block">
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
</pre>
</div>
<div class="section" id="transform-iterator-requirements">
<h1><a class="toc-backref" href="#id3" name="transform-iterator-requirements"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></h1>
@ -308,7 +319,7 @@ adding 4 to each element in the array:
<hr class="footer"/>
<div class="footer">
<a class="reference" href="transform_iterator.rst">View document source</a>.
Generated on: 2004-01-13 02:54 UTC.
Generated on: 2004-01-13 05:43 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
</body>