Sync from trunk (except adapt class)

[SVN r56714]
This commit is contained in:
Joel de Guzman
2009-10-11 16:12:54 +00:00
parent 7615b492af
commit 46fc256c2f
257 changed files with 13732 additions and 16068 deletions

View File

@ -3,10 +3,10 @@
<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.75.0">
<meta name="generator" content="DocBook XSL Stylesheets V1.65.1">
<link rel="home" 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">
<link rel="previous" href="extension/iterator_facade.html" title="Iterator Facade">
<link rel="next" href="functional/concepts.html" title="Concepts">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@ -22,10 +22,13 @@
<div class="spirit-nav">
<a accesskey="p" href="extension/iterator_facade.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="functional/concepts.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="Functional">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="fusion.functional"></a><a class="link" href="functional.html" title="Functional">Functional</a>
</h2></div></div></div>
<div class="section" lang="en">
<div class="titlepage">
<div><div><h2 class="title" style="clear: both">
<a name="fusion.functional"></a><a href="functional.html" title="Functional">Functional</a>
</h2></div></div>
<div></div>
</div>
<div class="toc"><dl>
<dt><span class="section"><a href="functional/concepts.html">Concepts</a></span></dt>
<dd><dl>
@ -62,17 +65,17 @@
Components to call functions and function objects and to make Fusion code callable
through a function object interface.
</p>
<a name="fusion.functional.header"></a><h4>
<a name="id744896"></a>
<a class="link" href="functional.html#fusion.functional.header">Header</a>
</h4>
<a name="fusion.functional.header"></a><h3>
<a name="id609210"></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><h4>
<a name="id744952"></a>
<a class="link" href="functional.html#fusion.functional.fused_and_unfused_forms">Fused and unfused
<a name="fusion.functional.fused_and_unfused_forms"></a><h3>
<a name="id609292"></a>
<a href="functional.html#fusion.functional.fused_and_unfused_forms">Fused and unfused
forms</a>
</h4>
</h3>
<p>
What is a function call?
</p>
@ -82,31 +85,31 @@
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 <code class="literal">(a,b,c)</code>
with some Fusion <a class="link" href="sequence.html" title="Sequence">Sequence</a>, introducing
Although the C++ syntax does not allow to replace <tt class="literal">(a,b,c)</tt>
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>
<p>
Alternatively it is possible to apply a simple transformation to <code class="literal">f</code>
Alternatively it is possible to apply a simple transformation to <tt class="literal">f</tt>
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>
<p>
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>.
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>.
Reading the above equivalence right-to-left to get the inverse transformation,
<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>.
<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>.
</p>
<a name="fusion.functional.calling_functions_and_function_objects"></a><h4>
<a name="id745136"></a>
<a class="link" href="functional.html#fusion.functional.calling_functions_and_function_objects">Calling
<a name="fusion.functional.calling_functions_and_function_objects"></a><h3>
<a name="id609552"></a>
<a href="functional.html#fusion.functional.calling_functions_and_function_objects">Calling
functions and function objects</a>
</h4>
</h3>
<p>
Having generic C++ code call back arbitrary functions provided by the client
used to be a heavily repetitive task, as different functions can differ in
@ -119,8 +122,9 @@
</p>
<p>
Transforming an unfused function into its fused counterpart allows n-ary calls
from an algorithm that invokes an unary <a class="link" href="functional/concepts/poly.html" title="Polymorphic Function Object">Polymorphic
Function Object</a> with <a class="link" href="sequence.html" title="Sequence">Sequence</a>
from an algorithm that invokes an unary <a href="functional/concepts/poly.html" title=" Polymorphic Function
Object">Polymorphic
Function Object</a> with <a href="sequence.html" title="Sequence">Sequence</a>
arguments.
</p>
<p>
@ -132,11 +136,11 @@
<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><h4>
<a name="id745181"></a>
<a class="link" href="functional.html#fusion.functional.making_fusion_code_callable_through_a_function_object_interface">Making
<a name="fusion.functional.making_fusion_code_callable_through_a_function_object_interface"></a><h3>
<a name="id609639"></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>
</h4>
</h3>
<p>
Transforming a fused function into its unfused counterpart allows to create
function objects to accept arbitrary calls. In other words, an unary function