forked from boostorg/fusion
updates functional module: only two unfused variants, now
[SVN r51381]
This commit is contained in:
@ -3,11 +3,11 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Notes</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="functional/generation/metafunctions/mk_unfused_rvargs.html" title="
|
||||
make_unfused_rvalue_args">
|
||||
<link rel="prev" href="functional/generation/metafunctions/mk_unfused.html" title="
|
||||
make_unfused">
|
||||
<link rel="next" href="change_log.html" title="Change log">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
@ -21,37 +21,37 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="functional/generation/metafunctions/mk_unfused_rvargs.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="change_log.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="functional/generation/metafunctions/mk_unfused.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="change_log.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="fusion.notes"></a><a href="notes.html" title="Notes">Notes</a></h2></div></div></div>
|
||||
<a name="fusion.notes.recursive_inlined_functions"></a><h3>
|
||||
<a name="id684861"></a>
|
||||
<a name="id1322248"></a>
|
||||
<a href="notes.html#fusion.notes.recursive_inlined_functions">Recursive Inlined
|
||||
Functions</a>
|
||||
</h3>
|
||||
<p>
|
||||
An interesting peculiarity of functions like <a href="sequence/intrinsic/functions/at.html" title="at"><tt class="computeroutput"><span class="identifier">at</span></tt></a> when applied to a <a href="sequence/concepts/forward_sequence.html" title="Forward
|
||||
An interesting peculiarity of functions like <a href="sequence/intrinsic/functions/at.html" title="at"><code class="computeroutput"><span class="identifier">at</span></code></a> when applied to a <a href="sequence/concepts/forward_sequence.html" title="Forward
|
||||
Sequence">Forward
|
||||
Sequence</a> like <a href="container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a>
|
||||
Sequence</a> like <a href="container/list.html" title="list"><code class="computeroutput"><span class="identifier">list</span></code></a>
|
||||
is that what could have been linear runtime complexity effectively becomes
|
||||
constant O(1) due to compiler optimization of C++ inlined functions, however
|
||||
deeply recursive (up to a certain compiler limit of course). Compile time complexity
|
||||
remains linear.
|
||||
</p>
|
||||
<a name="fusion.notes.overloaded_functions"></a><h3>
|
||||
<a name="id684935"></a>
|
||||
<a name="id1322317"></a>
|
||||
<a href="notes.html#fusion.notes.overloaded_functions">Overloaded Functions</a>
|
||||
</h3>
|
||||
<p>
|
||||
Associative sequences use function overloading to implement membership testing
|
||||
and type associated key lookup. This amounts to constant runtime and amortized
|
||||
constant compile time complexities. There is an overloaded function, <tt class="computeroutput"><span class="identifier">f</span><span class="special">(</span><span class="identifier">k</span><span class="special">)</span></tt>, for each key <span class="emphasis"><em>type</em></span> <tt class="computeroutput"><span class="identifier">k</span></tt>. The compiler chooses the appropriate function
|
||||
given a key, <tt class="computeroutput"><span class="identifier">k</span></tt>.
|
||||
constant compile time complexities. There is an overloaded function, <code class="computeroutput"><span class="identifier">f</span><span class="special">(</span><span class="identifier">k</span><span class="special">)</span></code>, for each key <span class="emphasis"><em>type</em></span> <code class="computeroutput"><span class="identifier">k</span></code>. The compiler chooses the appropriate function
|
||||
given a key, <code class="computeroutput"><span class="identifier">k</span></code>.
|
||||
</p>
|
||||
<a name="fusion.notes.tag_dispatching"></a><h3>
|
||||
<a name="id685019"></a>
|
||||
<a name="id1322392"></a>
|
||||
<a href="notes.html#fusion.notes.tag_dispatching">Tag Dispatching</a>
|
||||
</h3>
|
||||
<p>
|
||||
@ -70,11 +70,10 @@
|
||||
</li>
|
||||
</ol></div>
|
||||
<p>
|
||||
For example, the fusion <tt class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">begin</span></tt> metafunction
|
||||
For example, the fusion <code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">begin</span></code> metafunction
|
||||
is implemented as follows:
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Sequence</span><span class="special">></span>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Sequence</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">begin</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <span class="keyword">typename</span>
|
||||
@ -88,22 +87,22 @@
|
||||
</p>
|
||||
<div class="orderedlist"><ol type="1">
|
||||
<li>
|
||||
<tt class="computeroutput"><span class="identifier">Sequence</span></tt> is the type for
|
||||
which a suitable implementation of <tt class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">begin_impl</span></tt>
|
||||
<code class="computeroutput"><span class="identifier">Sequence</span></code> is the type for
|
||||
which a suitable implementation of <code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">begin_impl</span></code>
|
||||
is required
|
||||
</li>
|
||||
<li>
|
||||
<tt class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">tag_of</span></tt> is the metafunction that associates
|
||||
<tt class="computeroutput"><span class="identifier">Sequence</span></tt> with an appropriate
|
||||
<code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">tag_of</span></code> is the metafunction that associates
|
||||
<code class="computeroutput"><span class="identifier">Sequence</span></code> with an appropriate
|
||||
tag
|
||||
</li>
|
||||
<li>
|
||||
<tt class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">begin_impl</span></tt> is the template which is specialized
|
||||
<code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">begin_impl</span></code> is the template which is specialized
|
||||
to provide an implementation for each tag type
|
||||
</li>
|
||||
</ol></div>
|
||||
<a name="fusion.notes.extensibility"></a><h3>
|
||||
<a name="id685403"></a>
|
||||
<a name="id1322729"></a>
|
||||
<a href="notes.html#fusion.notes.extensibility">Extensibility</a>
|
||||
</h3>
|
||||
<p>
|
||||
@ -115,13 +114,13 @@
|
||||
and <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a> on account
|
||||
of the lazy nature of fusion <a href="algorithm.html" title="Algorithm">Algorithms</a>.
|
||||
<a href="http://en.wikipedia.org/wiki/Standard_Template_Library" target="_top">STL</a>
|
||||
containers extend themselves in place though member functions such as <a href="algorithm/transformation/functions/push_back.html" title="push_back"><tt class="computeroutput"><span class="identifier">push_back</span></tt></a> and <a href="algorithm/transformation/functions/insert.html" title="insert"><tt class="computeroutput"><span class="identifier">insert</span></tt></a>. <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>
|
||||
containers extend themselves in place though member functions such as <a href="algorithm/transformation/functions/push_back.html" title="push_back"><code class="computeroutput"><span class="identifier">push_back</span></code></a> and <a href="algorithm/transformation/functions/insert.html" title="insert"><code class="computeroutput"><span class="identifier">insert</span></code></a>. <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>
|
||||
sequences, on the other hand, are extended through "intrinsic" functions
|
||||
that actually return whole sequences. <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>
|
||||
is purely functional and can not have side effects. For example, <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>'s
|
||||
<tt class="computeroutput"><span class="identifier">push_back</span></tt> does not actually
|
||||
mutate an <tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">vector</span></tt>. It can't do that. Instead, it returns
|
||||
an extended <tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">vector</span></tt>.
|
||||
<code class="computeroutput"><span class="identifier">push_back</span></code> does not actually
|
||||
mutate an <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">vector</span></code>. It can't do that. Instead, it returns
|
||||
an extended <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">vector</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
Like <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>, Fusion
|
||||
@ -131,91 +130,84 @@
|
||||
are sequences that do not actually contain data, but instead impart an alternative
|
||||
presentation over the data from one or more underlying sequences. <a href="view.html" title="View">Views</a>
|
||||
are proxies. They provide an efficient yet purely functional way to work on
|
||||
potentially expensive sequence operations. For example, given a <a href="container/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a>, Fusion's <a href="algorithm/transformation/functions/push_back.html" title="push_back"><tt class="computeroutput"><span class="identifier">push_back</span></tt></a> returns a <a href="view/joint_view.html" title="joint_view"><tt class="computeroutput"><span class="identifier">joint_view</span></tt></a>, instead of an actual extended
|
||||
<a href="container/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a>.
|
||||
A <a href="view/joint_view.html" title="joint_view"><tt class="computeroutput"><span class="identifier">joint_view</span></tt></a>
|
||||
potentially expensive sequence operations. For example, given a <a href="container/vector.html" title="vector"><code class="computeroutput"><span class="identifier">vector</span></code></a>, Fusion's <a href="algorithm/transformation/functions/push_back.html" title="push_back"><code class="computeroutput"><span class="identifier">push_back</span></code></a> returns a <a href="view/joint_view.html" title="joint_view"><code class="computeroutput"><span class="identifier">joint_view</span></code></a>, instead of an actual extended
|
||||
<a href="container/vector.html" title="vector"><code class="computeroutput"><span class="identifier">vector</span></code></a>.
|
||||
A <a href="view/joint_view.html" title="joint_view"><code class="computeroutput"><span class="identifier">joint_view</span></code></a>
|
||||
holds a reference to the original sequence plus the appended data --making
|
||||
it very cheap to pass around.
|
||||
</p>
|
||||
<a name="fusion.notes.element_conversion"></a><h3>
|
||||
<a name="id685722"></a>
|
||||
<a name="id1323012"></a>
|
||||
<a href="notes.html#fusion.notes.element_conversion">Element Conversion</a>
|
||||
</h3>
|
||||
<p>
|
||||
Functions that take in elemental values to form sequences (e.g. <a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a>) convert their arguments
|
||||
Functions that take in elemental values to form sequences (e.g. <a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a>) convert their arguments
|
||||
to something suitable to be stored as a sequence element. In general, the element
|
||||
types are stored as plain values. Example:
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="char">'x'</span><span class="special">)</span>
|
||||
<pre class="programlisting"><a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="char">'x'</span><span class="special">)</span>
|
||||
</pre>
|
||||
<p>
|
||||
returns a <a href="container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><tt class="computeroutput"><span class="special"><</span><span class="keyword">int</span><span class="special">,</span>
|
||||
<span class="keyword">char</span><span class="special">></span></tt>.
|
||||
returns a <a href="container/list.html" title="list"><code class="computeroutput"><span class="identifier">list</span></code></a><code class="computeroutput"><span class="special"><</span><span class="keyword">int</span><span class="special">,</span>
|
||||
<span class="keyword">char</span><span class="special">></span></code>.
|
||||
</p>
|
||||
<p>
|
||||
There are a few exceptions, however.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>Arrays:</b></span>
|
||||
<span class="bold"><strong>Arrays:</strong></span>
|
||||
</p>
|
||||
<p>
|
||||
Array arguments are deduced to reference to const types. For example
|
||||
<sup>[<a name="id685881" href="#ftn.id685881">14</a>]</sup>
|
||||
<sup>[<a name="id1323153" href="#ftn.id1323153">14</a>]</sup>
|
||||
:
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a><span class="special">(</span><span class="string">"Donald"</span><span class="special">,</span> <span class="string">"Daisy"</span><span class="special">)</span>
|
||||
<pre class="programlisting"><a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a><span class="special">(</span><span class="string">"Donald"</span><span class="special">,</span> <span class="string">"Daisy"</span><span class="special">)</span>
|
||||
</pre>
|
||||
<p>
|
||||
creates a <a href="container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a>
|
||||
creates a <a href="container/list.html" title="list"><code class="computeroutput"><span class="identifier">list</span></code></a>
|
||||
of type
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<a href="container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">(&)[</span><span class="number">7</span><span class="special">],</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">(&)[</span><span class="number">6</span><span class="special">]></span>
|
||||
<pre class="programlisting"><a href="container/list.html" title="list"><code class="computeroutput"><span class="identifier">list</span></code></a><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">(&)[</span><span class="number">7</span><span class="special">],</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">(&)[</span><span class="number">6</span><span class="special">]></span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><b>Function pointers:</b></span>
|
||||
<span class="bold"><strong>Function pointers:</strong></span>
|
||||
</p>
|
||||
<p>
|
||||
Function pointers are deduced to the plain non-reference type (i.e. to plain
|
||||
function pointer). Example:
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span><span class="special">);</span>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span><span class="special">);</span>
|
||||
<span class="special">...</span>
|
||||
<a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a><span class="special">(&</span><span class="identifier">f</span><span class="special">);</span>
|
||||
<a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a><span class="special">(&</span><span class="identifier">f</span><span class="special">);</span>
|
||||
</pre>
|
||||
<p>
|
||||
creates a <a href="container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a>
|
||||
creates a <a href="container/list.html" title="list"><code class="computeroutput"><span class="identifier">list</span></code></a>
|
||||
of type
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<a href="container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><span class="special"><</span><span class="keyword">void</span> <span class="special">(*)(</span><span class="keyword">int</span><span class="special">)></span>
|
||||
<pre class="programlisting"><a href="container/list.html" title="list"><code class="computeroutput"><span class="identifier">list</span></code></a><span class="special"><</span><span class="keyword">void</span> <span class="special">(*)(</span><span class="keyword">int</span><span class="special">)></span>
|
||||
</pre>
|
||||
<a name="fusion.notes.boost__ref"></a><h3>
|
||||
<a name="id686316"></a>
|
||||
<a name="id1323535"></a>
|
||||
<a href="notes.html#fusion.notes.boost__ref">boost::ref</a>
|
||||
</h3>
|
||||
<p>
|
||||
Fusion's generation functions (e.g. <a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a>) by default stores the element
|
||||
Fusion's generation functions (e.g. <a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a>) by default stores the element
|
||||
types as plain non-reference types. Example:
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">void</span> <span class="identifier">foo</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">A</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">b</span><span class="special">)</span> <span class="special">{</span>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">foo</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">A</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">b</span><span class="special">)</span> <span class="special">{</span>
|
||||
<span class="special">...</span>
|
||||
<a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a><span class="special">(</span><span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span><span class="special">)</span>
|
||||
<a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a><span class="special">(</span><span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span><span class="special">)</span>
|
||||
</pre>
|
||||
<p>
|
||||
creates a <a href="container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a>
|
||||
creates a <a href="container/list.html" title="list"><code class="computeroutput"><span class="identifier">list</span></code></a>
|
||||
of type
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<a href="container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> <span class="identifier">B</span><span class="special">></span>
|
||||
<pre class="programlisting"><a href="container/list.html" title="list"><code class="computeroutput"><span class="identifier">list</span></code></a><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> <span class="identifier">B</span><span class="special">></span>
|
||||
</pre>
|
||||
<p>
|
||||
Sometimes the plain non-reference type is not desired. You can use <tt class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span></tt>
|
||||
and <tt class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">cref</span></tt> to store references or const references
|
||||
Sometimes the plain non-reference type is not desired. You can use <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span></code>
|
||||
and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">cref</span></code> to store references or const references
|
||||
(respectively) instead. The mechanism does not compromise const correctness
|
||||
since a const object wrapped with ref results in a tuple element with const
|
||||
reference type (see the fifth code line below). Examples:
|
||||
@ -223,13 +215,12 @@
|
||||
<p>
|
||||
For example:
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<span class="identifier">A</span> <span class="identifier">a</span><span class="special">;</span> <span class="identifier">B</span> <span class="identifier">b</span><span class="special">;</span> <span class="keyword">const</span> <span class="identifier">A</span> <span class="identifier">ca</span> <span class="special">=</span> <span class="identifier">a</span><span class="special">;</span>
|
||||
<a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a><span class="special">(</span><span class="identifier">cref</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="comment">// creates list<const A&, B>
|
||||
</span><a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a><span class="special">(</span><span class="identifier">ref</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="comment">// creates list<A&, B>
|
||||
</span><a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a><span class="special">(</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">a</span><span class="special">),</span> <span class="identifier">cref</span><span class="special">(</span><span class="identifier">b</span><span class="special">));</span> <span class="comment">// creates list<A&, const B&>
|
||||
</span><a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a><span class="special">(</span><span class="identifier">cref</span><span class="special">(</span><span class="identifier">ca</span><span class="special">));</span> <span class="comment">// creates list<const A&>
|
||||
</span><a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a><span class="special">(</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">ca</span><span class="special">));</span> <span class="comment">// creates list<const A&>
|
||||
<pre class="programlisting"><span class="identifier">A</span> <span class="identifier">a</span><span class="special">;</span> <span class="identifier">B</span> <span class="identifier">b</span><span class="special">;</span> <span class="keyword">const</span> <span class="identifier">A</span> <span class="identifier">ca</span> <span class="special">=</span> <span class="identifier">a</span><span class="special">;</span>
|
||||
<a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a><span class="special">(</span><span class="identifier">cref</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="comment">// creates list<const A&, B>
|
||||
</span><a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a><span class="special">(</span><span class="identifier">ref</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="comment">// creates list<A&, B>
|
||||
</span><a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a><span class="special">(</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">a</span><span class="special">),</span> <span class="identifier">cref</span><span class="special">(</span><span class="identifier">b</span><span class="special">));</span> <span class="comment">// creates list<A&, const B&>
|
||||
</span><a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a><span class="special">(</span><span class="identifier">cref</span><span class="special">(</span><span class="identifier">ca</span><span class="special">));</span> <span class="comment">// creates list<const A&>
|
||||
</span><a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a><span class="special">(</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">ca</span><span class="special">));</span> <span class="comment">// creates list<const A&>
|
||||
</span></pre>
|
||||
<p>
|
||||
See <a href="http://www.boost.org/doc/html/ref.html" target="_top">Boost.Ref</a> for
|
||||
@ -237,11 +228,11 @@
|
||||
</p>
|
||||
<div class="footnotes">
|
||||
<br><hr width="100" align="left">
|
||||
<div class="footnote"><p><sup>[<a name="ftn.id685881" href="#id685881">14</a>] </sup>
|
||||
<div class="footnote"><p><sup>[<a name="ftn.id1323153" href="#id1323153">14</a>] </sup>
|
||||
Note that the type of a string literal is an array of const characters,
|
||||
not <tt class="computeroutput"><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span></tt>. To get <a href="container/generation/functions/make_list.html" title="make_list"><tt class="computeroutput"><span class="identifier">make_list</span></tt></a> to create a <a href="container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a> with an element of a non-const
|
||||
array type one must use the <tt class="computeroutput"><span class="identifier">ref</span></tt>
|
||||
wrapper (see <a href="notes.html#fusion.notes.boost__ref"><tt class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span></tt></a>).
|
||||
not <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span></code>. To get <a href="container/generation/functions/make_list.html" title="make_list"><code class="computeroutput"><span class="identifier">make_list</span></code></a> to create a <a href="container/list.html" title="list"><code class="computeroutput"><span class="identifier">list</span></code></a> with an element of a non-const
|
||||
array type one must use the <code class="computeroutput"><span class="identifier">ref</span></code>
|
||||
wrapper (see <a href="notes.html#fusion.notes.boost__ref"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span></code></a>).
|
||||
</p></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -256,7 +247,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="functional/generation/metafunctions/mk_unfused_rvargs.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="change_log.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="functional/generation/metafunctions/mk_unfused.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="change_log.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user