more fixes from Dave

[SVN r21676]
This commit is contained in:
Jeremy Siek
2004-01-13 14:10:54 +00:00
parent 4e1b53ed36
commit 527b5e3caa
3 changed files with 39 additions and 30 deletions

View File

@ -94,21 +94,20 @@ class counting_iterator
type. Otherwise <tt class="literal"><span class="pre">difference_type</span></tt> is <tt class="literal"><span class="pre">Difference</span></tt>.</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 the member
<tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>. Otherwise, if
<tt class="literal"><span class="pre">Incrementable</span></tt> is a numberic type <tt class="literal"><span class="pre">iterator_category</span></tt> is a
type convertible to <tt class="literal"><span class="pre">random_access_iterator_tag</span></tt>. Otherwise,
<tt class="literal"><span class="pre">iterator_category</span></tt> is unspecified, and the <tt class="literal"><span class="pre">counting_iterator</span></tt>
specialization models the same iterator traversal concepts modeled
by <tt class="literal"><span class="pre">Incrementable</span></tt>.</p>
<tt class="literal"><span class="pre">numeric_limits&lt;Incrementable&gt;::is_specialized</span></tt>, then
<tt class="literal"><span class="pre">iterator_category</span></tt> is a type convertible to
<tt class="literal"><span class="pre">random_access_iterator_tag</span></tt>. Otherwise, <tt class="literal"><span class="pre">iterator_category</span></tt> is
unspecified, and the <tt class="literal"><span class="pre">counting_iterator</span></tt> specialization models the
same iterator traversal concepts modeled by <tt class="literal"><span class="pre">Incrementable</span></tt>.</p>
<dl>
<dt>[<em>Note:</em> implementers are encouraged to provide an implementation of</dt>
<dd><tt class="literal"><span class="pre">operator-</span></tt> and a <tt class="literal"><span class="pre">difference_type</span></tt> that avoid overflows in
<dd><tt class="literal"><span class="pre">operator-</span></tt> and a <tt class="literal"><span class="pre">difference_type</span></tt> that avoids overflows in
the cases when the <tt class="literal"><span class="pre">Incrementable</span></tt> type is a numeric type.]</dd>
</dl>
</div>
<div class="section" id="counting-iterator-requirements">
<h1><a class="toc-backref" href="#id3" name="counting-iterator-requirements"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></h1>
<p><tt class="literal"><span class="pre">Incrementable</span></tt> must be Default Constructible, Copy
Constructible, and Assignable.</p>
<p>The <tt class="literal"><span class="pre">Incrementable</span></tt> argument shall be Copy Constructible and Assignable.</p>
<p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <tt class="literal"><span class="pre">forward_iterator_tag</span></tt>
or <tt class="literal"><span class="pre">forward_traversal_tag</span></tt>, the following must be well-formed:</p>
<pre class="literal-block">
@ -136,7 +135,9 @@ i &lt; j;
<h1><a class="toc-backref" href="#id4" name="counting-iterator-models"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></h1>
<p>Specializations of <tt class="literal"><span class="pre">counting_iterator</span></tt> model Readable Lvalue
Iterator. In addition, they model the concepts corresponding to the
iterator tags to which their <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible.</p>
iterator tags to which their <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible and
also corresponding to <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> when
<tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is an iterator tag (and not <tt class="literal"><span class="pre">use_default</span></tt>).</p>
</div>
<div class="section" id="counting-iterator-operations">
<h1><a class="toc-backref" href="#id5" name="counting-iterator-operations"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></h1>
@ -148,6 +149,8 @@ operations.</p>
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="literal"><span class="pre">Incrementable</span></tt> is Default Constructible.</td>
</tr>
<tr class="field"><th class="field-name">Effects:</th><td class="field-body">Default construct the member <tt class="literal"><span class="pre">m_inc</span></tt>.</td>
</tr>
</tbody>
@ -261,7 +264,7 @@ indirectly printing out the numbers from 0 to 7
<hr class="footer" />
<div class="footer">
<a class="reference" href="counting_iterator.rst">View document source</a>.
Generated on: 2004-01-13 13:15 UTC.
Generated on: 2004-01-13 14:10 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>