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>

View File

@ -32,21 +32,20 @@ type. Otherwise ``difference_type`` is ``Difference``.
If ``CategoryOrTraversal`` is not ``use_default`` then the member
``iterator_category`` is ``CategoryOrTraversal``. Otherwise, if
``Incrementable`` is a numberic type ``iterator_category`` is a
type convertible to ``random_access_iterator_tag``. Otherwise,
``iterator_category`` is unspecified, and the ``counting_iterator``
specialization models the same iterator traversal concepts modeled
by ``Incrementable``.
``numeric_limits<Incrementable>::is_specialized``, then
``iterator_category`` is a type convertible to
``random_access_iterator_tag``. Otherwise, ``iterator_category`` is
unspecified, and the ``counting_iterator`` specialization models the
same iterator traversal concepts modeled by ``Incrementable``.
[*Note:* implementers are encouraged to provide an implementation of
``operator-`` and a ``difference_type`` that avoid overflows in
``operator-`` and a ``difference_type`` that avoids overflows in
the cases when the ``Incrementable`` type is a numeric type.]
``counting_iterator`` requirements
..................................
``Incrementable`` must be Default Constructible, Copy
Constructible, and Assignable.
The ``Incrementable`` argument shall be Copy Constructible and Assignable.
If ``iterator_category`` is convertible to ``forward_iterator_tag``
or ``forward_traversal_tag``, the following must be well-formed::
@ -76,7 +75,9 @@ the following must must also be valid::
Specializations of ``counting_iterator`` model Readable Lvalue
Iterator. In addition, they model the concepts corresponding to the
iterator tags to which their ``iterator_category`` is convertible.
iterator tags to which their ``iterator_category`` is convertible and
also corresponding to ``CategoryOrTraversal`` when
``CategoryOrTraversal`` is an iterator tag (and not ``use_default``).
``counting_iterator`` operations
@ -89,6 +90,7 @@ operations.
``counting_iterator();``
:Requires: ``Incrementable`` is Default Constructible.
:Effects: Default construct the member ``m_inc``.

View File

@ -2017,7 +2017,8 @@ or else``m_iter == end``. The member <tt class="literal"><span class="pre">m_pre
<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">Predicate</span></tt> must be Default Constructible.</td>
<tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="literal"><span class="pre">Predicate</span></tt> must be Default Constructible and
<tt class="literal"><span class="pre">Predicate</span></tt> is a class type (not a function pointer).</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">A <tt class="literal"><span class="pre">filter_iterator</span></tt> where <tt class="literal"><span class="pre">m_iter</span></tt> is either
the first position in the range <tt class="literal"><span class="pre">[x,end)</span></tt> such that <tt class="literal"><span class="pre">m_pred(*m_iter)</span> <span class="pre">==</span> <span class="pre">true</span></tt>
@ -2131,21 +2132,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">
<h4><a class="toc-backref" href="#id63" name="counting-iterator-requirements"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></h4>
<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">
@ -2173,7 +2173,9 @@ i &lt; j;
<h4><a class="toc-backref" href="#id64" name="counting-iterator-models"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></h4>
<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">
<h4><a class="toc-backref" href="#id65" name="counting-iterator-operations"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></h4>
@ -2185,6 +2187,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>
@ -2343,7 +2347,7 @@ LocalWords: OtherIncrementable Coplien -->
<hr class="footer" />
<div class="footer">
<a class="reference" href="facade-and-adaptor.rst">View document source</a>.
Generated on: 2004-01-13 13:48 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>