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

@ -80,9 +80,20 @@ private:
Iterator m_iterator; // exposition
};
</pre>
<p>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">reverse_iterator</span></tt>, as described in the models section.</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">T</span></tt> be
<tt class="literal"><span class="pre">iterator_traits&lt;Iterator&gt;::value_type</span></tt>, <tt class="literal"><span class="pre">R</span></tt> be
<tt class="literal"><span class="pre">iterator_traits&lt;Iterator&gt;::reference</span></tt>, and <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 (R is a reference to T) then
if (C is convertible to random_access_traversal_tag) then
random_access_iterator_tag
else
bidirectional_iterator_tag
else
input_iterator_tag
</pre>
</div>
<div class="section" id="reverse-iterator-requirements">
<h1><a class="toc-backref" href="#id3" name="reverse-iterator-requirements"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></h1>
@ -266,7 +277,7 @@ sequence in double-reversed (normal) order: hello world!
<hr class="footer"/>
<div class="footer">
<a class="reference" href="reverse_iterator.rst">View document source</a>.
Generated on: 2004-01-13 02:54 UTC.
Generated on: 2004-01-13 05:39 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>