mirror of
https://github.com/boostorg/iterator.git
synced 2025-08-03 23:04:30 +02:00
Really re-resolved title level problem
A few minor edits [SVN r21634]
This commit is contained in:
@@ -75,14 +75,12 @@ by adapting other iterators.</td>
|
||||
<li><a class="reference" href="#proposed-text" id="id25" name="id25">Proposed Text</a><ul>
|
||||
<li><a class="reference" href="#header-iterator-helper-synopsis-lib-iterator-helper-synopsis" id="id26" name="id26">Header <tt class="literal"><span class="pre"><iterator_helper></span></tt> synopsis [lib.iterator.helper.synopsis]</a></li>
|
||||
<li><a class="reference" href="#iterator-facade-lib-iterator-facade" id="id27" name="id27">Iterator facade [lib.iterator.facade]</a><ul>
|
||||
<li><a class="reference" href="#class-template-iterator-facade" id="id28" name="id28">Class template <tt class="literal"><span class="pre">iterator_facade</span></tt></a><ul>
|
||||
<li><a class="reference" href="#class-template-iterator-facade" id="id28" name="id28">Class template <tt class="literal"><span class="pre">iterator_facade</span></tt></a></li>
|
||||
<li><a class="reference" href="#iterator-facade-requirements" id="id29" name="id29"><tt class="literal"><span class="pre">iterator_facade</span></tt> Requirements</a></li>
|
||||
<li><a class="reference" href="#iterator-facade-iterator-category" id="id30" name="id30"><tt class="literal"><span class="pre">iterator_facade</span></tt> iterator category</a></li>
|
||||
<li><a class="reference" href="#iterator-facade-operations" id="id31" name="id31"><tt class="literal"><span class="pre">iterator_facade</span></tt> operations</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference" href="#iterator-adaptor-lib-iterator-adaptor" id="id32" name="id32">Iterator adaptor [lib.iterator.adaptor]</a><ul>
|
||||
<li><a class="reference" href="#class-template-iterator-adaptor" id="id33" name="id33">Class template <tt class="literal"><span class="pre">iterator_adaptor</span></tt></a></li>
|
||||
<li><a class="reference" href="#iterator-adaptor-base-class-parameters" id="id34" name="id34"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> base class parameters</a></li>
|
||||
@@ -285,11 +283,11 @@ identified the following core behaviors for iterators:</p>
|
||||
include the associated types exposed through iterator traits:
|
||||
<tt class="literal"><span class="pre">value_type</span></tt>, <tt class="literal"><span class="pre">reference</span></tt>, <tt class="literal"><span class="pre">difference_type</span></tt>, and
|
||||
<tt class="literal"><span class="pre">iterator_category</span></tt>.</p>
|
||||
<p>Iterator facade uses the Curiously Recurring Template Pattern (CRTP)
|
||||
<a class="citation-reference" href="#cop95" id="id4" name="id4">[Cop95]</a> so that the user can specify the behavior of
|
||||
<tt class="literal"><span class="pre">iterator_facade</span></tt> in a derived class. Former designs used policy
|
||||
objects to specify the behavior. <tt class="literal"><span class="pre">iterator_facade</span></tt> does not use policy
|
||||
objects for several reasons:</p>
|
||||
<p>Iterator facade uses the Curiously Recurring Template
|
||||
Pattern (CRTP) <a class="citation-reference" href="#cop95" id="id4" name="id4">[Cop95]</a> so that the user can specify the behavior
|
||||
of <tt class="literal"><span class="pre">iterator_facade</span></tt> in a derived class. Former designs used
|
||||
policy objects to specify the behavior, but that approach was
|
||||
discarded for several reasons:</p>
|
||||
<blockquote>
|
||||
<ol class="arabic simple">
|
||||
<li>the creation and eventual copying of the policy object may create
|
||||
@@ -299,9 +297,11 @@ on the created iterator types, an essential feature if
|
||||
<tt class="literal"><span class="pre">iterator_facade</span></tt> should be used in other library
|
||||
implementations.</li>
|
||||
<li>Without the use of CRTP, the standard requirement that an
|
||||
iterator's <tt class="literal"><span class="pre">operator++</span></tt> returns the iterator type itself means
|
||||
that all iterators generated by <tt class="literal"><span class="pre">iterator_facade</span></tt> would be
|
||||
specializations of <tt class="literal"><span class="pre">iterator_facade</span></tt>. Cumbersome type generator
|
||||
iterator's <tt class="literal"><span class="pre">operator++</span></tt> returns the iterator type itself
|
||||
would mean that all iterators built with the library would
|
||||
have to be specializations of <tt class="literal"><span class="pre">iterator_facade<...></span></tt>, rather
|
||||
than something more descriptive like
|
||||
<tt class="literal"><span class="pre">indirect_iterator<T*></span></tt>. Cumbersome type generator
|
||||
metafunctions would be needed to build new parameterized
|
||||
iterators, and a separate <tt class="literal"><span class="pre">iterator_adaptor</span></tt> layer would be
|
||||
impossible.</li>
|
||||
@@ -437,9 +437,10 @@ is a class, however, it must still be possible to access members
|
||||
through <tt class="literal"><span class="pre">operator-></span></tt>. Therefore, an iterator whose <tt class="literal"><span class="pre">reference</span></tt>
|
||||
type is not in fact a reference must return a proxy containing a copy
|
||||
of the referenced value from its <tt class="literal"><span class="pre">operator-></span></tt>.</p>
|
||||
<p>The return type for <tt class="literal"><span class="pre">operator-></span></tt> and <tt class="literal"><span class="pre">operator[]</span></tt> is not
|
||||
explicitly specified. Instead it requires each <tt class="literal"><span class="pre">iterator_facade</span></tt>
|
||||
specialization to meet the requirements of its <tt class="literal"><span class="pre">iterator_category</span></tt>.</p>
|
||||
<p>The return types for <tt class="literal"><span class="pre">iterator_facade</span></tt>'s <tt class="literal"><span class="pre">operator-></span></tt> and
|
||||
<tt class="literal"><span class="pre">operator[]</span></tt> are not explicitly specified. Instead, those types
|
||||
are described in terms of a set of requirements, which must be
|
||||
satisfied by the <tt class="literal"><span class="pre">iterator_facade</span></tt> implementation.</p>
|
||||
<table class="citation" frame="void" id="cop95" rules="none">
|
||||
<colgroup><col class="label" /><col /></colgroup>
|
||||
<col />
|
||||
@@ -707,8 +708,9 @@ struct enable_if_interoperable
|
||||
>
|
||||
{};
|
||||
</pre>
|
||||
</div>
|
||||
<div class="section" id="iterator-facade-requirements">
|
||||
<h4><a class="toc-backref" href="#id29" name="iterator-facade-requirements"><tt class="literal"><span class="pre">iterator_facade</span></tt> Requirements</a></h4>
|
||||
<h3><a class="toc-backref" href="#id29" name="iterator-facade-requirements"><tt class="literal"><span class="pre">iterator_facade</span></tt> Requirements</a></h3>
|
||||
<p>The following table describes the typical valid expressions on
|
||||
<tt class="literal"><span class="pre">iterator_facade</span></tt>'s <tt class="literal"><span class="pre">Derived</span></tt> parameter, depending on the
|
||||
iterator concept(s) it will model. The operations in the first
|
||||
@@ -789,7 +791,7 @@ Iterator</td>
|
||||
</div>
|
||||
<a class="target" id="facade-iterator-category" name="facade-iterator-category"></a></div>
|
||||
<div class="section" id="iterator-facade-iterator-category">
|
||||
<h4><a class="toc-backref" href="#id30" name="iterator-facade-iterator-category"><tt class="literal"><span class="pre">iterator_facade</span></tt> iterator category</a></h4>
|
||||
<h3><a class="toc-backref" href="#id30" name="iterator-facade-iterator-category"><tt class="literal"><span class="pre">iterator_facade</span></tt> iterator category</a></h3>
|
||||
<p>The <tt class="literal"><span class="pre">iterator_category</span></tt> member of <tt class="literal"><span class="pre">iterator_facade<X,V,R,C,D></span></tt>
|
||||
is a type which satisfies the following conditions:</p>
|
||||
<blockquote>
|
||||
@@ -842,7 +844,7 @@ convertible, and not to any more-derived traversal tag type.</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="section" id="iterator-facade-operations">
|
||||
<h4><a class="toc-backref" href="#id31" name="iterator-facade-operations"><tt class="literal"><span class="pre">iterator_facade</span></tt> operations</a></h4>
|
||||
<h3><a class="toc-backref" href="#id31" name="iterator-facade-operations"><tt class="literal"><span class="pre">iterator_facade</span></tt> operations</a></h3>
|
||||
<p>The operations in this section are described in terms of operations on
|
||||
the core interface of <tt class="literal"><span class="pre">Derived</span></tt> which may be inaccessible
|
||||
(i.e. private). The implementation should access these operations
|
||||
@@ -983,7 +985,6 @@ return tmp -= n;
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="iterator-adaptor-lib-iterator-adaptor">
|
||||
<h2><a class="toc-backref" href="#id32" name="iterator-adaptor-lib-iterator-adaptor">Iterator adaptor [lib.iterator.adaptor]</a></h2>
|
||||
<!-- Version 1.1 of this ReStructuredText document corresponds to
|
||||
@@ -2237,7 +2238,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-12 16:01 UTC.
|
||||
Generated on: 2004-01-12 17:28 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>
|
||||
|
Reference in New Issue
Block a user