updates functional module: only two unfused variants, now

[SVN r51381]
This commit is contained in:
Tobias Schwinger
2009-02-22 06:27:12 +00:00
parent 2fdfd41b17
commit aaf89a67a6
263 changed files with 5823 additions and 7742 deletions

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Functional</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="../index.html" title="Chapter<65>1.<2E>Fusion 2.0">
<link rel="up" href="../index.html" title="Chapter<65>1.<2E>Fusion 2.0">
<link rel="prev" href="extension/iterator_facade.html" title="Iterator Facade">
@ -40,16 +40,16 @@
<dd><dl>
<dt><span class="section"><a href="functional/invocation/functions.html">Functions</a></span></dt>
<dt><span class="section"><a href="functional/invocation/metafunctions.html">Metafunctions</a></span></dt>
<dt><span class="section"><a href="functional/invocation/limits.html">Limits</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="functional/adapters.html"> Adapters</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="functional/adapters/fused.html">fused</a></span></dt>
<dt><span class="section"><a href="functional/adapters/fused_procedure.html">fused_procedure</a></span></dt>
<dt><span class="section"><a href="functional/adapters/fused_function_object.html">fused_function_object</a></span></dt>
<dt><span class="section"><a href="functional/adapters/unfused_generic.html">unfused_generic</a></span></dt>
<dt><span class="section"><a href="functional/adapters/unfused_lvalue_args.html">unfused_lvalue_args</a></span></dt>
<dt><span class="section"><a href="functional/adapters/unfused_rvalue_args.html">unfused_rvalue_args</a></span></dt>
<dt><span class="section"><a href="functional/adapters/unfused.html">unfused</a></span></dt>
<dt><span class="section"><a href="functional/adapters/unfused_typed.html">unfused_typed</a></span></dt>
<dt><span class="section"><a href="functional/adapters/limits.html">Limits</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="functional/generation.html">Generation</a></span></dt>
<dd><dl>
@ -61,48 +61,48 @@
Components to call functions and function objects and to make Fusion code callable
through a function object interface.
</p>
<p>
/functional.hpp&gt;
</p>
<a name="fusion.functional.header"></a><h3>
<a name="id1282710"></a>
<a href="functional.html#fusion.functional.header">Header</a>
</h3>
<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">functional</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<a name="fusion.functional.fused_and_unfused_forms"></a><h3>
<a name="id653897"></a>
<a name="id1282783"></a>
<a href="functional.html#fusion.functional.fused_and_unfused_forms">Fused and unfused
forms</a>
</h3>
<p>
What is a function call?
</p>
<pre class="programlisting">
<span class="identifier">f</span> <span class="special">(</span><span class="identifier">a</span><span class="special">,</span><span class="identifier">b</span><span class="special">,</span><span class="identifier">c</span><span class="special">)</span>
<pre class="programlisting"><span class="identifier">f</span> <span class="special">(</span><span class="identifier">a</span><span class="special">,</span><span class="identifier">b</span><span class="special">,</span><span class="identifier">c</span><span class="special">)</span>
</pre>
<p>
It is a name and a tuple written next to each other, left-to-right.
</p>
<p>
Although the C++ syntax does not allow to replace <tt class="literal">(a,b,c)</tt>
Although the C++ syntax does not allow to replace <code class="literal">(a,b,c)</code>
with some Fusion <a href="sequence.html" title="Sequence">Sequence</a>, introducing
yet another function provides a solution:
</p>
<pre class="programlisting">
<span class="identifier">invoke</span><span class="special">(</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">my_sequence</span><span class="special">)</span>
<pre class="programlisting"><span class="identifier">invoke</span><span class="special">(</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">my_sequence</span><span class="special">)</span>
</pre>
<p>
Alternatively it is possible to apply a simple transformation to <tt class="literal">f</tt>
Alternatively it is possible to apply a simple transformation to <code class="literal">f</code>
in order to achieve the same effect:
</p>
<pre class="programlisting">
<span class="identifier">f</span> <span class="identifier">tuple</span> <span class="special">&lt;=&gt;</span> f' <span class="special">(</span><span class="identifier">tuple</span><span class="special">)</span>
<pre class="programlisting"><span class="identifier">f</span> <span class="identifier">tuple</span> <span class="special">&lt;=&gt;</span> f' <span class="special">(</span><span class="identifier">tuple</span><span class="special">)</span>
</pre>
<p>
Now, <tt class="literal">f'</tt> is an unary function that takes the arguments to
<tt class="computeroutput"><span class="identifier">f</span></tt> as a tuple; <tt class="literal">f'</tt>
is the <span class="emphasis"><em>fused</em></span> form of <tt class="computeroutput"><span class="identifier">f</span></tt>.
Now, <code class="literal">f'</code> is an unary function that takes the arguments to
<code class="computeroutput"><span class="identifier">f</span></code> as a tuple; <code class="literal">f'</code>
is the <span class="emphasis"><em>fused</em></span> form of <code class="computeroutput"><span class="identifier">f</span></code>.
Reading the above equivalence right-to-left to get the inverse transformation,
<tt class="computeroutput"><span class="identifier">f</span></tt> is the <span class="emphasis"><em>unfused</em></span>
form of <tt class="literal">f'</tt>.
<code class="computeroutput"><span class="identifier">f</span></code> is the <span class="emphasis"><em>unfused</em></span>
form of <code class="literal">f'</code>.
</p>
<a name="fusion.functional.calling_functions_and_function_objects"></a><h3>
<a name="id654163"></a>
<a name="id1283014"></a>
<a href="functional.html#fusion.functional.calling_functions_and_function_objects">Calling
functions and function objects</a>
</h3>
@ -129,8 +129,11 @@
variant has a corresponding generator function template that returns an adapter
instance for the given argument.
</p>
<p>
Constructors can be called applying <a href="http://www.boost.org/libs/functional/factory/doc/html/index.html" target="_top">Boost.Functional/Factory</a>.
</p>
<a name="fusion.functional.making_fusion_code_callable_through_a_function_object_interface"></a><h3>
<a name="id654239"></a>
<a name="id1283085"></a>
<a href="functional.html#fusion.functional.making_fusion_code_callable_through_a_function_object_interface">Making
Fusion code callable through a function object interface</a>
</h3>
@ -141,11 +144,14 @@
or function call operators.
</p>
<p>
The library provides several adapter variants that implement this transformation,
ranging from strictly typed to fully generic. The latter provides a reusable,
approximate solution to <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm" target="_top">The
Forwarding Problem</a>. Every generic variant has a corresponding generator
function template that returns an adapter instance for the given argument.
The library provides both a strictly typed and a generic variant for this transformation.
The latter should be used in combination with <a href="http://www.boost.org/libs/functional/forward/doc/html/index.html" target="_top">Boost.Functional/Forward</a>
to attack <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm" target="_top">The
Forwarding Problem</a>.
</p>
<p>
Both variants have a corresponding generator function template that returns
an adapter instance for the given argument.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>