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

@ -116,7 +116,7 @@ else
typedef Reference reference;
if (Value is use_default) then
typedef ?? pointer;
typedef iterator_traits<V>::value_type* pointer;
else
typedef Value* pointer;
@ -125,9 +125,21 @@ if (Difference is use_default)
else
typedef Difference difference_type;
</pre>
<p>The member <tt class="literal"><span class="pre">iterator_category</span></tt> is a type that satisfies the
requirements of the concepts modeled by the <tt class="literal"><span class="pre">indirect_iterator</span></tt> as
specified in the models section.</p>
<p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is not <tt class="literal"><span class="pre">use_default</span></tt> then
<tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>. Otherwise
<tt class="literal"><span class="pre">iterator_category</span></tt> is a type convertible to the tag determined 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="indirect-iterator-requirements">
<h1><a class="toc-backref" href="#id3" name="indirect-iterator-requirements"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></h1>
@ -135,7 +147,7 @@ specified in the models section.</p>
Iterator. The <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> argument shall be one of the
standard iterator tags or <tt class="literal"><span class="pre">use_default</span></tt>. If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>
is an iterator tag, the template parameter <tt class="literal"><span class="pre">Iterator</span></tt> argument shall
meet the traversal requirements corresponding to the iterator tag.</p>
meet the requirements corresponding to the iterator tag.</p>
<p>The expression <tt class="literal"><span class="pre">*v</span></tt>, where <tt class="literal"><span class="pre">v</span></tt> is an object of type
<tt class="literal"><span class="pre">iterator_traits&lt;Iterator&gt;::value_type</span></tt>, must be a valid expression
and must be convertible to <tt class="literal"><span class="pre">indirect_iterator::reference</span></tt>. Also
@ -315,7 +327,7 @@ a,b,c,d,e,f,g,
<hr class="footer"/>
<div class="footer">
<a class="reference" href="indirect_iterator.rst">View document source</a>.
Generated on: 2004-01-13 02:54 UTC.
Generated on: 2004-01-13 05:55 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>