• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE</title>
5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.2">
8<link rel="up" href="../adapted.html" title="Adapted">
9<link rel="prev" href="define_struct_inline.html" title="BOOST_FUSION_DEFINE_STRUCT_INLINE">
10<link rel="next" href="define_assoc_struct.html" title="BOOST_FUSION_DEFINE_ASSOC_STRUCT">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="define_struct_inline.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="define_assoc_struct.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h3 class="title">
27<a name="fusion.adapted.define_tpl_struct_inline"></a><a class="link" href="define_tpl_struct_inline.html" title="BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE">BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE</a>
28</h3></div></div></div>
29<h5>
30<a name="fusion.adapted.define_tpl_struct_inline.h0"></a>
31        <span class="phrase"><a name="fusion.adapted.define_tpl_struct_inline.description"></a></span><a class="link" href="define_tpl_struct_inline.html#fusion.adapted.define_tpl_struct_inline.description">Description</a>
32      </h5>
33<p>
34        BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE is a macro that can be used to generate
35        all the necessary boilerplate to define and adapt an arbitrary template struct
36        as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random
37        Access Sequence</a>. Unlike BOOST_FUSION_DEFINE_TPL_STRUCT, it can be
38        used at class or namespace scope.
39      </p>
40<h5>
41<a name="fusion.adapted.define_tpl_struct_inline.h1"></a>
42        <span class="phrase"><a name="fusion.adapted.define_tpl_struct_inline.synopsis"></a></span><a class="link" href="define_tpl_struct_inline.html#fusion.adapted.define_tpl_struct_inline.synopsis">Synopsis</a>
43      </h5>
44<pre class="programlisting"><span class="identifier">BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE</span><span class="special">(</span>
45    <span class="special">(</span><span class="identifier">template_param0</span><span class="special">)(</span><span class="identifier">template_param1</span><span class="special">)...,</span>
46    <span class="identifier">struct_name</span><span class="special">,</span>
47    <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">)</span>
48    <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">)</span>
49    <span class="special">...</span>
50    <span class="special">)</span>
51</pre>
52<h5>
53<a name="fusion.adapted.define_tpl_struct_inline.h2"></a>
54        <span class="phrase"><a name="fusion.adapted.define_tpl_struct_inline.expression_semantics"></a></span><a class="link" href="define_tpl_struct_inline.html#fusion.adapted.define_tpl_struct_inline.expression_semantics">Expression
55        Semantics</a>
56      </h5>
57<p>
58        The semantics of BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE are identical to those
59        of BOOST_FUSION_DEFINE_TPL_STRUCT, with two differences:
60      </p>
61<div class="orderedlist"><ol class="orderedlist" type="1">
62<li class="listitem">
63            BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE can be used at class or namespace
64            scope, and thus does not take a namespace list parameter.
65          </li>
66<li class="listitem">
67            The structure generated by BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE has
68            a base class, and is thus not POD in C++03.
69          </li>
70</ol></div>
71<h5>
72<a name="fusion.adapted.define_tpl_struct_inline.h3"></a>
73        <span class="phrase"><a name="fusion.adapted.define_tpl_struct_inline.header"></a></span><a class="link" href="define_tpl_struct_inline.html#fusion.adapted.define_tpl_struct_inline.header">Header</a>
74      </h5>
75<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">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">define_struct_inline</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
76<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">define_struct_inline</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
77</pre>
78<h5>
79<a name="fusion.adapted.define_tpl_struct_inline.h4"></a>
80        <span class="phrase"><a name="fusion.adapted.define_tpl_struct_inline.example"></a></span><a class="link" href="define_tpl_struct_inline.html#fusion.adapted.define_tpl_struct_inline.example">Example</a>
81      </h5>
82<pre class="programlisting"><span class="comment">// Any instantiated enclosing::employee is a Fusion sequence</span>
83<span class="keyword">class</span> <span class="identifier">enclosing</span>
84<span class="special">{</span>
85    <span class="identifier">BOOST_FUSION_DEFINE_TPL_STRUCT</span><span class="special">(</span>
86        <span class="special">(</span><span class="identifier">Name</span><span class="special">)(</span><span class="identifier">Age</span><span class="special">),</span> <span class="identifier">employee</span><span class="special">,</span>
87        <span class="special">(</span><span class="identifier">Name</span><span class="special">,</span> <span class="identifier">name</span><span class="special">)</span>
88        <span class="special">(</span><span class="identifier">Age</span><span class="special">,</span> <span class="identifier">age</span><span class="special">))</span>
89<span class="special">};</span>
90</pre>
91</div>
92<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
93<td align="left"></td>
94<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman,
95      Dan Marsden, Tobias Schwinger<p>
96        Distributed under the Boost Software License, Version 1.0. (See accompanying
97        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>)
98      </p>
99</div></td>
100</tr></table>
101<hr>
102<div class="spirit-nav">
103<a accesskey="p" href="define_struct_inline.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="define_assoc_struct.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
104</div>
105</body>
106</html>
107