forked from boostorg/fusion
updates functional module: only two unfused variants, now
[SVN r51381]
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title> BOOST_FUSION_ADAPT_STRUCT</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="../adapted.html" title="Adapted">
|
||||
<link rel="prev" href="boost__tuple.html" title="boost::tuple">
|
||||
@ -26,7 +26,7 @@
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="fusion.adapted.adapt_struct"></a><a href="adapt_struct.html" title=" BOOST_FUSION_ADAPT_STRUCT"> BOOST_FUSION_ADAPT_STRUCT</a></h3></div></div></div>
|
||||
<a name="fusion.adapted.adapt_struct.description"></a><h4>
|
||||
<a name="id577189"></a>
|
||||
<a name="id1146664"></a>
|
||||
<a href="adapt_struct.html#fusion.adapted.adapt_struct.description">Description</a>
|
||||
</h4>
|
||||
<p>
|
||||
@ -36,11 +36,10 @@
|
||||
Access Sequence</a>.
|
||||
</p>
|
||||
<a name="fusion.adapted.adapt_struct.synopsis"></a><h4>
|
||||
<a name="id577230"></a>
|
||||
<a name="id1146701"></a>
|
||||
<a href="adapt_struct.html#fusion.adapted.adapt_struct.synopsis">Synopsis</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="identifier">BOOST_FUSION_ADAPT_STRUCT</span><span class="special">(</span>
|
||||
<pre class="programlisting"><span class="identifier">BOOST_FUSION_ADAPT_STRUCT</span><span class="special">(</span>
|
||||
<span class="identifier">struct_name</span>
|
||||
<span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">)</span>
|
||||
<span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">)</span>
|
||||
@ -48,36 +47,34 @@
|
||||
<span class="special">)</span>
|
||||
</pre>
|
||||
<a name="fusion.adapted.adapt_struct.semantics"></a><h4>
|
||||
<a name="id577347"></a>
|
||||
<a name="id1146802"></a>
|
||||
<a href="adapt_struct.html#fusion.adapted.adapt_struct.semantics">Semantics</a>
|
||||
</h4>
|
||||
<p>
|
||||
The above macro generates the necessary code to adapt <tt class="computeroutput"><span class="identifier">struct_name</span></tt>
|
||||
The above macro generates the necessary code to adapt <code class="computeroutput"><span class="identifier">struct_name</span></code>
|
||||
as a model of <a href="../sequence/concepts/random_access_sequence.html" title="Random
|
||||
Access Sequence">Random
|
||||
Access Sequence</a>. The sequence of <tt class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span>
|
||||
<span class="identifier">member_nameN</span><span class="special">)</span></tt>
|
||||
Access Sequence</a>. The sequence of <code class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span>
|
||||
<span class="identifier">member_nameN</span><span class="special">)</span></code>
|
||||
pairs declare the type and names of each of the struct members that will
|
||||
be part of the sequence.
|
||||
</p>
|
||||
<p>
|
||||
The macro should be used at global scope, and <tt class="computeroutput"><span class="identifier">struct_name</span></tt>
|
||||
The macro should be used at global scope, and <code class="computeroutput"><span class="identifier">struct_name</span></code>
|
||||
should be the fully namespace qualified name of the struct to be converted.
|
||||
</p>
|
||||
<a name="fusion.adapted.adapt_struct.header"></a><h4>
|
||||
<a name="id577451"></a>
|
||||
<a name="id1146894"></a>
|
||||
<a href="adapt_struct.html#fusion.adapted.adapt_struct.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">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">adapt_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
<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">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">adapt_struct</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">adapt_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
</pre>
|
||||
<a name="fusion.adapted.adapt_struct.example"></a><h4>
|
||||
<a name="id577618"></a>
|
||||
<a name="id1147041"></a>
|
||||
<a href="adapt_struct.html#fusion.adapted.adapt_struct.example">Example</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">namespace</span> <span class="identifier">demo</span>
|
||||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">demo</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">employee</span>
|
||||
<span class="special">{</span>
|
||||
|
Reference in New Issue
Block a user