forked from boostorg/fusion
Added docs for copy
[SVN r72930]
This commit is contained in:
@ -46,18 +46,17 @@
|
||||
</dl></dd>
|
||||
</dl></div>
|
||||
<a name="fusion.algorithm.lazy_evaluation"></a><h4>
|
||||
<a name="id1014665"></a>
|
||||
<a name="id1017942"></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 and non sequence-type preserving. 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. 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 functional in nature such that algorithms are non mutating
|
||||
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
|
||||
@ -69,7 +68,7 @@
|
||||
as we want without incurring a high runtime penalty.
|
||||
</p>
|
||||
<a name="fusion.algorithm.sequence_extension"></a><h4>
|
||||
<a name="id1014748"></a>
|
||||
<a name="id1018054"></a>
|
||||
<a class="link" href="algorithm.html#fusion.algorithm.sequence_extension">Sequence Extension</a>
|
||||
</h4>
|
||||
<p>
|
||||
@ -84,17 +83,32 @@
|
||||
and the value <code class="computeroutput"><span class="identifier">x</span></code>. Functions
|
||||
that were once sequence specific and need to be implemented N times over N
|
||||
different sequences are now implemented only once. That is to say that Fusion
|
||||
sequences are cheaply extensible. To regain the original sequence, <a class="link" href="container/conversion/functions.html" title="Functions">Conversion</a>
|
||||
sequences are cheaply extensible.
|
||||
</p>
|
||||
<p>
|
||||
To regain the original sequence, <a class="link" href="container/conversion/functions.html" title="Functions">Conversion</a>
|
||||
functions are provided. You may use one of the <a class="link" href="container/conversion/functions.html" title="Functions">Conversion</a>
|
||||
functions to convert back to the original sequence type.
|
||||
</p>
|
||||
<a name="fusion.algorithm.header"></a><h4>
|
||||
<a name="id1014856"></a>
|
||||
<a name="id1018165"></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>
|
||||
<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">include</span><span class="special">/</span><span class="identifier">algorithm</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
</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>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
|
Reference in New Issue
Block a user