forked from boostorg/fusion
make single_view random access
[SVN r72977]
This commit is contained in:
@ -46,20 +46,18 @@
|
||||
</dl></dd>
|
||||
</dl></div>
|
||||
<a name="fusion.algorithm.lazy_evaluation"></a><h4>
|
||||
<a name="id1017942"></a>
|
||||
<a name="fusion.algorithm.lazy_evaluation-heading"></a>
|
||||
<a class="link" href="algorithm.html#fusion.algorithm.lazy_evaluation">Lazy Evaluation</a>
|
||||
</h4>
|
||||
<p>
|
||||
Unlike <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>, Fusion
|
||||
algorithms are lazy
|
||||
<sup>[<a name="id1017958" href="#ftn.id1017958" class="footnote">10</a>]</sup>
|
||||
and non sequence-type preserving
|
||||
<sup>[<a name="id1017986" href="#ftn.id1017986" class="footnote">11</a>]</sup>
|
||||
. This is by design. Runtime efficiency is given a high priority. Like <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>, and unlike <a href="http://en.wikipedia.org/wiki/Standard_Template_Library" target="_top">STL</a>, fusion
|
||||
algorithms are mostly functional in nature such that algorithms are non mutating
|
||||
(no side effects). However, due to the high cost of returning full sequences
|
||||
such as vectors and lists, <span class="emphasis"><em>Views</em></span> are returned from Fusion
|
||||
algorithms instead. For example, the <a class="link" href="algorithm/transformation/functions/transform.html" title="transform"><code class="computeroutput"><span class="identifier">transform</span></code></a> algorithm does not actually
|
||||
algorithms are lazy<sup>[<a name="id1025231" href="#ftn.id1025231" class="footnote">10</a>]</sup> and non sequence-type preserving <sup>[<a name="id1025259" href="#ftn.id1025259" class="footnote">11</a>]</sup>. This is by design. Runtime efficiency is given a high priority.
|
||||
Like <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>, and
|
||||
unlike <a href="http://en.wikipedia.org/wiki/Standard_Template_Library" target="_top">STL</a>,
|
||||
fusion algorithms are mostly functional in nature such that algorithms are
|
||||
non mutating (no side effects). However, due to the high cost of returning
|
||||
full sequences such as vectors and lists, <span class="emphasis"><em>Views</em></span> are returned
|
||||
from Fusion algorithms instead. For example, the <a class="link" href="algorithm/transformation/functions/transform.html" title="transform"><code class="computeroutput"><span class="identifier">transform</span></code></a> algorithm does not actually
|
||||
return a transformed version of the original sequence. <a class="link" href="algorithm/transformation/functions/transform.html" title="transform"><code class="computeroutput"><span class="identifier">transform</span></code></a> returns a <a class="link" href="view/transform_view.html" title="transform_view"><code class="computeroutput"><span class="identifier">transform_view</span></code></a>. This view holds a
|
||||
reference to the original sequence plus the transform function. Iteration over
|
||||
the <a class="link" href="view/transform_view.html" title="transform_view"><code class="computeroutput"><span class="identifier">transform_view</span></code></a>
|
||||
@ -68,7 +66,7 @@
|
||||
as we want without incurring a high runtime penalty.
|
||||
</p>
|
||||
<a name="fusion.algorithm.sequence_extension"></a><h4>
|
||||
<a name="id1018054"></a>
|
||||
<a name="fusion.algorithm.sequence_extension-heading"></a>
|
||||
<a class="link" href="algorithm.html#fusion.algorithm.sequence_extension">Sequence Extension</a>
|
||||
</h4>
|
||||
<p>
|
||||
@ -91,7 +89,7 @@
|
||||
functions to convert back to the original sequence type.
|
||||
</p>
|
||||
<a name="fusion.algorithm.header"></a><h4>
|
||||
<a name="id1018165"></a>
|
||||
<a name="fusion.algorithm.header-heading"></a>
|
||||
<a class="link" href="algorithm.html#fusion.algorithm.header">Header</a>
|
||||
</h4>
|
||||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">algorithm</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
@ -99,15 +97,15 @@
|
||||
</pre>
|
||||
<div class="footnotes">
|
||||
<br><hr width="100" align="left">
|
||||
<div class="footnote"><p><sup>[<a name="ftn.id1017958" href="#id1017958" class="para">10</a>] </sup>
|
||||
Except for some special cases such as <a class="link" href="algorithm/iteration/functions/for_each.html" title="for_each"><code class="computeroutput"><span class="identifier">for_each</span></code></a> and <a class="link" href="algorithm/auxiliary/functions/copy.html" title="copy"><code class="computeroutput"><span class="identifier">copy</span></code></a> which are inherently imperative
|
||||
algorithms.
|
||||
</p></div>
|
||||
<div class="footnote"><p><sup>[<a name="ftn.id1017986" href="#id1017986" class="para">11</a>] </sup>
|
||||
What does that mean? It means that when you operate on a sequence through
|
||||
a Fusion algorithm that returns a sequence, the sequence returned may not
|
||||
be of the same class as the original
|
||||
</p></div>
|
||||
<div class="footnote"><p><sup>[<a name="ftn.id1025231" href="#id1025231" class="para">10</a>] </sup>
|
||||
Except for some special cases such as <a class="link" href="algorithm/iteration/functions/for_each.html" title="for_each"><code class="computeroutput"><span class="identifier">for_each</span></code></a> and <a class="link" href="algorithm/auxiliary/functions/copy.html" title="copy"><code class="computeroutput"><span class="identifier">copy</span></code></a> which are inherently imperative
|
||||
algorithms.
|
||||
</p></div>
|
||||
<div class="footnote"><p><sup>[<a name="ftn.id1025259" href="#id1025259" class="para">11</a>] </sup>
|
||||
What does that mean? It means that when you operate on a sequence through
|
||||
a Fusion algorithm that returns a sequence, the sequence returned may not
|
||||
be of the same class as the original
|
||||
</p></div>
|
||||
</div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
|
Reference in New Issue
Block a user