make single_view random access

[SVN r72977]
This commit is contained in:
Eric Niebler
2011-07-08 19:42:35 +00:00
parent 0a54764a6a
commit f27ed26e44
276 changed files with 4030 additions and 4061 deletions

View File

@ -24,7 +24,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="fusion.extension.ext_full"></a><a class="link" href="ext_full.html" title="The Full Extension Mechanism"> The Full Extension Mechanism</a>
<a name="fusion.extension.ext_full"></a><a class="link" href="ext_full.html" title="The Full Extension Mechanism">The Full Extension Mechanism</a>
</h3></div></div></div>
<p>
The Fusion library is designed to be extensible, new sequences types can
@ -37,19 +37,20 @@
</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
Enable the <a class="link" href="../notes.html#fusion.notes.tag_dispatching"><span class="emphasis"><em>tag dispatching</em></span></a>
mechanism used by Fusion for your sequence type
</li>
Enable the <a class="link" href="../notes.html#fusion.notes.tag_dispatching"><span class="emphasis"><em>tag
dispatching</em></span></a> mechanism used by Fusion for your sequence
type
</li>
<li class="listitem">
Design an iterator type for the sequence
</li>
Design an iterator type for the sequence
</li>
<li class="listitem">
Provide specialized behaviour for the intrinsic operations of the new Fusion
sequence
</li>
Provide specialized behaviour for the intrinsic operations of the new
Fusion sequence
</li>
</ol></div>
<a name="fusion.extension.ext_full.our_example"></a><h5>
<a name="id1091712"></a>
<a name="fusion.extension.ext_full.our_example-heading"></a>
<a class="link" href="ext_full.html#fusion.extension.ext_full.our_example">Our example</a>
</h5>
<p>
@ -79,7 +80,7 @@
Start</a> guide.
</p>
<a name="fusion.extension.ext_full.enabling_tag_dispatching"></a><h5>
<a name="id1091916"></a>
<a name="fusion.extension.ext_full.enabling_tag_dispatching-heading"></a>
<a class="link" href="ext_full.html#fusion.extension.ext_full.enabling_tag_dispatching">Enabling
Tag Dispatching</a>
</h5>
@ -90,8 +91,8 @@
a new tag type for the mechanism to use. For example:
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">example</span> <span class="special">{</span>
<span class="keyword">struct</span> <span class="identifier">example_sequence_tag</span><span class="special">;</span> <span class="comment">// Only definition needed
</span><span class="special">}</span>
<span class="keyword">struct</span> <span class="identifier">example_sequence_tag</span><span class="special">;</span> <span class="comment">// Only definition needed</span>
<span class="special">}</span>
</pre>
<p>
Next we need to enable the <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">tag_of</span></code>
@ -120,7 +121,7 @@
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">tag_of</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<a name="fusion.extension.ext_full.designing_a_suitable_iterator"></a><h5>
<a name="id1092352"></a>
<a name="fusion.extension.ext_full.designing_a_suitable_iterator-heading"></a>
<a class="link" href="ext_full.html#fusion.extension.ext_full.designing_a_suitable_iterator">Designing
a suitable iterator</a>
</h5>
@ -154,23 +155,23 @@
</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
The iterator is parameterized by the type it is iterating over, and the
index of the current element.
</li>
The iterator is parameterized by the type it is iterating over, and the
index of the current element.
</li>
<li class="listitem">
The typedefs <code class="computeroutput"><span class="identifier">struct_type</span></code>
and <code class="computeroutput"><span class="identifier">index</span></code> provide convenient
access to information we will need later in the implementation.
</li>
The typedefs <code class="computeroutput"><span class="identifier">struct_type</span></code>
and <code class="computeroutput"><span class="identifier">index</span></code> provide convenient
access to information we will need later in the implementation.
</li>
<li class="listitem">
The typedef <code class="computeroutput"><span class="identifier">category</span></code> allows
the <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><a class="link" href="../support/category_of.html" title="category_of"><code class="computeroutput"><span class="identifier">category_of</span></code></a></code>
metafunction to establish the traversal category of the iterator.
</li>
The typedef <code class="computeroutput"><span class="identifier">category</span></code>
allows the <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><a class="link" href="../support/category_of.html" title="category_of"><code class="computeroutput"><span class="identifier">category_of</span></code></a></code>
metafunction to establish the traversal category of the iterator.
</li>
<li class="listitem">
The constructor stores a reference to the <code class="computeroutput"><span class="identifier">example_struct</span></code>
being iterated over.
</li>
The constructor stores a reference to the <code class="computeroutput"><span class="identifier">example_struct</span></code>
being iterated over.
</li>
</ol></div>
<p>
We also need to enable <a class="link" href="../notes.html#fusion.notes.tag_dispatching"><span class="emphasis"><em>tag
@ -182,7 +183,7 @@
clearer as we add features to our implementation.
</p>
<a name="fusion.extension.ext_full.a_first_couple_of_instructive_features"></a><h5>
<a name="id1092810"></a>
<a name="fusion.extension.ext_full.a_first_couple_of_instructive_features-heading"></a>
<a class="link" href="ext_full.html#fusion.extension.ext_full.a_first_couple_of_instructive_features">A
first couple of instructive features</a>
</h5>
@ -322,7 +323,7 @@
</p></td></tr>
</table></div>
<a name="fusion.extension.ext_full.implementing_the_remaining_iterator_functionality"></a><h5>
<a name="id1095541"></a>
<a name="fusion.extension.ext_full.implementing_the_remaining_iterator_functionality-heading"></a>
<a class="link" href="ext_full.html#fusion.extension.ext_full.implementing_the_remaining_iterator_functionality">Implementing
the remaining iterator functionality</a>
</h5>
@ -373,7 +374,7 @@
are provided in the example code.
</p>
<a name="fusion.extension.ext_full.implementing_the_intrinsic_functions_of_the_sequence"></a><h5>
<a name="id1095985"></a>
<a name="fusion.extension.ext_full.implementing_the_intrinsic_functions_of_the_sequence-heading"></a>
<a class="link" href="ext_full.html#fusion.extension.ext_full.implementing_the_intrinsic_functions_of_the_sequence">Implementing
the intrinsic functions of the sequence</a>
</h5>
@ -429,7 +430,7 @@
<code class="computeroutput"><span class="identifier">value_at_impl</span></code> and <code class="computeroutput"><span class="identifier">at_impl</span></code>.
</p>
<a name="fusion.extension.ext_full.enabling_our_type_as_an_associative_sequence"></a><h5>
<a name="id1096396"></a>
<a name="fusion.extension.ext_full.enabling_our_type_as_an_associative_sequence-heading"></a>
<a class="link" href="ext_full.html#fusion.extension.ext_full.enabling_our_type_as_an_associative_sequence">Enabling
our type as an associative sequence</a>
</h5>
@ -437,9 +438,8 @@
In order for <code class="computeroutput"><span class="identifier">example_struct</span></code>
to serve as an associative forward sequence, we need to adapt the traversal
category of our sequence and our iterator accordingly and enable 3 intrinsic
sequence lookup features, <a class="link" href="../sequence/intrinsic/functions/at_key.html" title="at_key"><code class="computeroutput"><span class="identifier">at_key</span></code></a>, __value_at<span class="underline">key</span>_
and <a class="link" href="../sequence/intrinsic/functions/has_key.html" title="has_key"><code class="computeroutput"><span class="identifier">has_key</span></code></a>. We also need to enable
3 iterator lookup features, <a class="link" href="../iterator/metafunctions/key_of.html" title="key_of"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">key_of</span></code></a>, <a class="link" href="../iterator/metafunctions/value_of_data.html" title="value_of_data"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">value_of_data</span></code></a> and <a class="link" href="../iterator/functions/deref_data.html" title="deref_data"><code class="computeroutput"><span class="identifier">deref_data</span></code></a>.
sequence lookup features, <a class="link" href="../sequence/intrinsic/functions/at_key.html" title="at_key"><code class="computeroutput"><span class="identifier">at_key</span></code></a>, __value_at_key__ and <a class="link" href="../sequence/intrinsic/functions/has_key.html" title="has_key"><code class="computeroutput"><span class="identifier">has_key</span></code></a>.
We also need to enable 3 iterator lookup features, <a class="link" href="../iterator/metafunctions/key_of.html" title="key_of"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">key_of</span></code></a>, <a class="link" href="../iterator/metafunctions/value_of_data.html" title="value_of_data"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">value_of_data</span></code></a> and <a class="link" href="../iterator/functions/deref_data.html" title="deref_data"><code class="computeroutput"><span class="identifier">deref_data</span></code></a>.
</p>
<p>
To implement <code class="computeroutput"><span class="identifier">at_key_impl</span></code>
@ -494,7 +494,7 @@
are provided in the example code.
</p>
<a name="fusion.extension.ext_full.summary"></a><h5>
<a name="id1098198"></a>
<a name="fusion.extension.ext_full.summary-heading"></a>
<a class="link" href="ext_full.html#fusion.extension.ext_full.summary">Summary</a>
</h5>
<p>

View File

@ -27,7 +27,7 @@
<a name="fusion.extension.iterator_facade"></a><a class="link" href="iterator_facade.html" title="Iterator Facade">Iterator Facade</a>
</h3></div></div></div>
<a name="fusion.extension.iterator_facade.description"></a><h5>
<a name="id1099504"></a>
<a name="fusion.extension.iterator_facade.description-heading"></a>
<a class="link" href="iterator_facade.html#fusion.extension.iterator_facade.description">Description</a>
</h5>
<p>
@ -36,14 +36,14 @@
iterator.
</p>
<a name="fusion.extension.iterator_facade.synopsis"></a><h5>
<a name="id1099530"></a>
<a name="fusion.extension.iterator_facade.synopsis-heading"></a>
<a class="link" href="iterator_facade.html#fusion.extension.iterator_facade.synopsis">Synopsis</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Derived</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">TravesalTag</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <span class="identifier">iterator_facade</span><span class="special">;</span>
</pre>
<a name="fusion.extension.iterator_facade.usage"></a><h5>
<a name="id1099594"></a>
<a name="fusion.extension.iterator_facade.usage-heading"></a>
<a class="link" href="iterator_facade.html#fusion.extension.iterator_facade.usage">Usage</a>
</h5>
<p>
@ -57,7 +57,7 @@
type.
</p>
<div class="table">
<a name="id1099611"></a><p class="title"><b>Table&#160;1.104.&#160;Parameters</b></p>
<a name="id1110388"></a><p class="title"><b>Table&#160;1.104.&#160;Parameters</b></p>
<div class="table-contents"><table class="table" summary="Parameters">
<colgroup>
<col>
@ -106,7 +106,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id1099736"></a><p class="title"><b>Table&#160;1.105.&#160;Key Expressions</b></p>
<a name="id1110513"></a><p class="title"><b>Table&#160;1.105.&#160;Key Expressions</b></p>
<div class="table-contents"><table class="table" summary="Key Expressions">
<colgroup>
<col>
@ -442,14 +442,14 @@
</table></div>
</div>
<br class="table-break"><a name="fusion.extension.iterator_facade.header"></a><h5>
<a name="id1102486"></a>
<a name="fusion.extension.iterator_facade.header-heading"></a>
<a class="link" href="iterator_facade.html#fusion.extension.iterator_facade.header">Header</a>
</h5>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">iterator</span><span class="special">/</span><span class="identifier">iterator_facade</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">iterator_facade</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<a name="fusion.extension.iterator_facade.example"></a><h5>
<a name="id1102594"></a>
<a name="fusion.extension.iterator_facade.example-heading"></a>
<a class="link" href="iterator_facade.html#fusion.extension.iterator_facade.example">Example</a>
</h5>
<p>

View File

@ -27,7 +27,7 @@
<a name="fusion.extension.sequence_facade"></a><a class="link" href="sequence_facade.html" title="Sequence Facade">Sequence Facade</a>
</h3></div></div></div>
<a name="fusion.extension.sequence_facade.description"></a><h5>
<a name="id1098263"></a>
<a name="fusion.extension.sequence_facade.description-heading"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.description">Description</a>
</h5>
<p>
@ -36,14 +36,14 @@
sequence.
</p>
<a name="fusion.extension.sequence_facade.synopsis"></a><h5>
<a name="id1098290"></a>
<a name="fusion.extension.sequence_facade.synopsis-heading"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.synopsis">Synopsis</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Derived</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">TravesalTag</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">IsView</span> <span class="special">=</span> <span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <span class="identifier">sequence_facade</span><span class="special">;</span>
</pre>
<a name="fusion.extension.sequence_facade.usage"></a><h5>
<a name="id1098383"></a>
<a name="fusion.extension.sequence_facade.usage-heading"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.usage">Usage</a>
</h5>
<p>
@ -59,7 +59,7 @@
type.
</p>
<div class="table">
<a name="id1098435"></a><p class="title"><b>Table&#160;1.102.&#160;Parameters</b></p>
<a name="id1108433"></a><p class="title"><b>Table&#160;1.102.&#160;Parameters</b></p>
<div class="table-contents"><table class="table" summary="Parameters">
<colgroup>
<col>
@ -107,7 +107,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id1098545"></a><p class="title"><b>Table&#160;1.103.&#160;Key Expressions</b></p>
<a name="id1109316"></a><p class="title"><b>Table&#160;1.103.&#160;Key Expressions</b></p>
<div class="table-contents"><table class="table" summary="Key Expressions">
<colgroup>
<col>
@ -272,14 +272,14 @@
</table></div>
</div>
<br class="table-break"><a name="fusion.extension.sequence_facade.include"></a><h5>
<a name="id1099359"></a>
<a name="fusion.extension.sequence_facade.include-heading"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.include">Include</a>
</h5>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">sequence</span><span class="special">/</span><span class="identifier">sequence_facade</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">sequence_facade</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<a name="fusion.extension.sequence_facade.example"></a><h5>
<a name="id1099467"></a>
<a name="fusion.extension.sequence_facade.example-heading"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.example">Example</a>
</h5>
<p>