fusion: merge of associative iterators/views and the new fold interface

[SVN r58618]
This commit is contained in:
Christopher Schmidt
2010-01-01 22:00:21 +00:00
parent b605617c4f
commit cda74605fc
379 changed files with 28481 additions and 2185 deletions

View File

@ -1,11 +1,20 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Quick Start</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
<<<<<<< .working
<meta name="generator" content="DocBook XSL Stylesheets V1.65.1">
=======
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<<<<<<< .working
>>>>>>> .merge-right.r57125
<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="home" href="../index.html" title="Chapter&#160;1.&#160;Fusion 2.0">
<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Fusion 2.0">
>>>>>>> .merge-right.r58299
<link rel="previous" href="introduction.html" title="Introduction">
<link rel="next" href="organization.html" title="Organization">
</head>
@ -36,16 +45,26 @@
is more or less a synonym for fusion's <tt class="computeroutput"><a href="container/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a></tt>.
</p>
<p>
<<<<<<< .working
For starters, we shall include all of Fusion's <a href="sequence.html" title="Sequence">Sequence</a>(s)
<sup>[<a name="id409214" href="#ftn.id409214">2</a>]</sup>
=======
For starters, we shall include all of Fusion's <a class="link" href="sequence.html" title="Sequence">Sequence</a>(s)
<sup>[<a name="id614839" href="#ftn.id614839" class="footnote">2</a>]</sup>
>>>>>>> .merge-right.r57125
:
</p>
<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">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</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<p>
<<<<<<< .working
Let's begin with a <tt class="computeroutput"><a href="container/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a></tt>
<sup>[<a name="id409361" href="#ftn.id409361">3</a>]</sup>
=======
Let's begin with a <code class="computeroutput"><a class="link" href="container/vector.html" title="vector"><code class="computeroutput"><span class="identifier">vector</span></code></a></code>
<sup>[<a name="id614954" href="#ftn.id614954" class="footnote">3</a>]</sup>
>>>>>>> .merge-right.r57125
:
</p>
<pre class="programlisting"><a href="container/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&gt;</span> <span class="identifier">stuff</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="char">'x'</span><span class="special">,</span> <span class="string">"howdy"</span><span class="special">);</span>
@ -61,9 +80,15 @@
there. You can do a lot more with Fusion <tt class="computeroutput"><a href="container/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a></tt> or <tt class="computeroutput"><span class="identifier">tuple</span></tt>.
Let's see some examples.
</p>
<<<<<<< .working
<a name="fusion.quick_start.print_the_vector_as_xml"></a><h3>
<a name="id409777"></a>
<a href="quick_start.html#fusion.quick_start.print_the_vector_as_xml">Print the vector
=======
<a name="fusion.quick_start.print_the_vector_as_xml"></a><h4>
<a name="id615270"></a>
<a class="link" href="quick_start.html#fusion.quick_start.print_the_vector_as_xml">Print the vector
>>>>>>> .merge-right.r57125
as XML</a>
</h3>
<p>
@ -116,10 +141,17 @@
<tt class="computeroutput"><span class="identifier">print_xml</span></tt>, you can use it to
print just about any Fusion <a href="sequence.html" title="Sequence">Sequence</a>.
</p>
<<<<<<< .working
<a name="fusion.quick_start.print_only_pointers"></a><h3>
<a name="id410372"></a>
<a href="quick_start.html#fusion.quick_start.print_only_pointers">Print only pointers</a>
</h3>
=======
<a name="fusion.quick_start.print_only_pointers"></a><h4>
<a name="id617917"></a>
<a class="link" href="quick_start.html#fusion.quick_start.print_only_pointers">Print only pointers</a>
</h4>
>>>>>>> .merge-right.r57125
<p>
Let's get a little cleverer. Say we wish to write a <span class="emphasis"><em>generic</em></span>
function that takes in an arbitrary sequence and XML prints only those elements
@ -148,10 +180,17 @@
<p>
Easy, right?
</p>
<<<<<<< .working
<a name="fusion.quick_start.associative_tuples"></a><h3>
<a name="id410736"></a>
<a href="quick_start.html#fusion.quick_start.associative_tuples">Associative tuples</a>
</h3>
=======
<a name="fusion.quick_start.associative_tuples"></a><h4>
<a name="id618190"></a>
<a class="link" href="quick_start.html#fusion.quick_start.associative_tuples">Associative tuples</a>
</h4>
>>>>>>> .merge-right.r57125
<p>
Ok, moving on...
</p>
@ -220,10 +259,17 @@
regardless if it is a <tt class="computeroutput"><span class="identifier">person</span></tt>,
a <tt class="computeroutput"><span class="identifier">dog</span></tt> or a whole <tt class="computeroutput"><span class="identifier">alternate_universe</span></tt>.
</p>
<<<<<<< .working
<a name="fusion.quick_start.tip_of_the_iceberg"></a><h3>
<a name="id411650"></a>
<a href="quick_start.html#fusion.quick_start.tip_of_the_iceberg">Tip of the Iceberg</a>
</h3>
=======
<a name="fusion.quick_start.tip_of_the_iceberg"></a><h4>
<a name="id618901"></a>
<a class="link" href="quick_start.html#fusion.quick_start.tip_of_the_iceberg">Tip of the Iceberg</a>
</h4>
>>>>>>> .merge-right.r57125
<p>
And... we've barely scratched the surface! You can compose and expand the data
structures, remove elements from the structures, find specific data types,
@ -232,21 +278,71 @@
</p>
<div class="footnotes">
<br><hr width="100" align="left">
<<<<<<< .working
<<<<<<< .working
<<<<<<< .working
<<<<<<< .working
<<<<<<< .working
<<<<<<< .working
<div class="footnote"><p><sup>[<a name="ftn.id409214" href="#id409214">2</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id658449" href="#id658449" class="para">2</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id614209" href="#id614209" class="para">2</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id606563" href="#id606563" class="para">2</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id629518" href="#id629518" class="para">2</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id618116" href="#id618116" class="para">2</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id614839" href="#id614839" class="para">2</a>] </sup>
>>>>>>> .merge-right.r58559
>>>>>>> .merge-right.r58549
>>>>>>> .merge-right.r58299
>>>>>>> .merge-right.r57337
>>>>>>> .merge-right.r57242
>>>>>>> .merge-right.r57125
There are finer grained header files available if you wish to have more
control over which components to include (see section <a href="organization.html" title="Organization">Orgainization</a>
for details).
</p></div>
<<<<<<< .working
<<<<<<< .working
<<<<<<< .working
<<<<<<< .working
<<<<<<< .working
<<<<<<< .working
<div class="footnote"><p><sup>[<a name="ftn.id409361" href="#id409361">3</a>] </sup>
Unless otherwise noted, components are in namespace <tt class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">fusion</span></tt>.
For the sake of simplicity, code in this quick start implies <tt class="computeroutput"><span class="keyword">using</span></tt> directives for the fusion components
=======
<div class="footnote"><p><sup>[<a name="ftn.id658564" href="#id658564" class="para">3</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id614324" href="#id614324" class="para">3</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id606678" href="#id606678" class="para">3</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id629633" href="#id629633" class="para">3</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id618231" href="#id618231" class="para">3</a>] </sup>
=======
<div class="footnote"><p><sup>[<a name="ftn.id614954" href="#id614954" class="para">3</a>] </sup>
>>>>>>> .merge-right.r58559
>>>>>>> .merge-right.r58549
>>>>>>> .merge-right.r58299
>>>>>>> .merge-right.r57337
>>>>>>> .merge-right.r57242
Unless otherwise noted, components are in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">fusion</span></code>.
For the sake of simplicity, code in this quick start implies <code class="computeroutput"><span class="keyword">using</span></code> directives for the fusion components
>>>>>>> .merge-right.r57125
we will be using.
</p></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright <EFBFBD> 2001-2007 Joel de Guzman, Dan Marsden, Tobias
<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2007 Joel de Guzman, Dan Marsden, Tobias
Schwinger<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)