Imported Upstream version 1.51.0
[platform/upstream/boost.git] / libs / fusion / doc / html / fusion / adapted.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Adapted</title>
5 <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Fusion 2.1">
8 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Fusion 2.1">
9 <link rel="prev" href="view/repetitive_view.html" title="repetitive_view">
10 <link rel="next" href="adapted/array.html" title="Array">
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="view/repetitive_view.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="adapted/array.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="fusion.adapted"></a><a class="link" href="adapted.html" title="Adapted">Adapted</a>
28 </h2></div></div></div>
29 <div class="toc"><dl>
30 <dt><span class="section"><a href="adapted/array.html">Array</a></span></dt>
31 <dt><span class="section"><a href="adapted/std__pair.html">std::pair</a></span></dt>
32 <dt><span class="section"><a href="adapted/mpl_sequence.html">mpl sequence</a></span></dt>
33 <dt><span class="section"><a href="adapted/boost__array.html">boost::array</a></span></dt>
34 <dt><span class="section"><a href="adapted/boost__tuple.html">boost::tuple</a></span></dt>
35 <dt><span class="section"><a href="adapted/adapt_struct.html">BOOST_FUSION_ADAPT_STRUCT</a></span></dt>
36 <dt><span class="section"><a href="adapted/adapt_tpl_struct.html">BOOST_FUSION_ADAPT_TPL_STRUCT</a></span></dt>
37 <dt><span class="section"><a href="adapted/adapt_struct_named.html">BOOST_FUSION_ADAPT_STRUCT_NAMED</a></span></dt>
38 <dt><span class="section"><a href="adapted/adapt_assoc.html">BOOST_FUSION_ADAPT_ASSOC_STRUCT</a></span></dt>
39 <dt><span class="section"><a href="adapted/adapt_assoc_tpl_struct.html">BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT</a></span></dt>
40 <dt><span class="section"><a href="adapted/adapt_assoc_struct_named.html">BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED</a></span></dt>
41 <dt><span class="section"><a href="adapted/adapt_adt.html">BOOST_FUSION_ADAPT_ADT</a></span></dt>
42 <dt><span class="section"><a href="adapted/adapt_tpl_adt.html">BOOST_FUSION_ADAPT_TPL_ADT</a></span></dt>
43 <dt><span class="section"><a href="adapted/adapt_assoc_adt.html">BOOST_FUSION_ADAPT_ASSOC_ADT</a></span></dt>
44 <dt><span class="section"><a href="adapted/adapt_assoc_tpl_adt.html">BOOST_FUSION_ADAPT_ASSOC_TPL_ADT</a></span></dt>
45 <dt><span class="section"><a href="adapted/define_struct.html">BOOST_FUSION_DEFINE_STRUCT</a></span></dt>
46 <dt><span class="section"><a href="adapted/define_tpl_struct.html">BOOST_FUSION_DEFINE_TPL_STRUCT</a></span></dt>
47 <dt><span class="section"><a href="adapted/define_struct_inline.html">BOOST_FUSION_DEFINE_STRUCT_INLINE</a></span></dt>
48 <dt><span class="section"><a href="adapted/define_tpl_struct_inline.html">BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE</a></span></dt>
49 <dt><span class="section"><a href="adapted/define_assoc_struct.html">BOOST_FUSION_DEFINE_ASSOC_STRUCT</a></span></dt>
50 <dt><span class="section"><a href="adapted/define_assoc_tpl_struct.html">BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT</a></span></dt>
51 </dl></div>
52 <p>
53       Fusion provides a couple of adapters for other sequences such as arrays, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>,
54       <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a> sequences,
55       and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span></code>. These adapters are written using Fusion's
56       non-intrusive <a class="link" href="extension.html" title="Extension">Extension</a> mechanism.
57       If you wish to use these sequences with fusion, simply include the necessary
58       files and they will be regarded as first-class, fully conforming fusion sequences.
59     </p>
60 <p>
61       Fusion also provides various schemes to make it easy for the user to adapt
62       various data structures, non-intrusively, as full fledged Fusion sequences.
63     </p>
64 <h4>
65 <a name="fusion.adapted.h0"></a>
66       <span><a name="fusion.adapted.header"></a></span><a class="link" href="adapted.html#fusion.adapted.header">Header</a>
67     </h4>
68 <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="identifier">hpp</span><span class="special">&gt;</span>
69 <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">adapted</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
70 </pre>
71 <p>
72       Fusion sequences may also be adapted as fully conforming <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>
73       sequences (see <a class="link" href="sequence/intrinsic.html" title="Intrinsic">Intrinsics</a>).
74       That way, we can have 2-way adaptation to and from <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>
75       and Fusion. To make Fusion sequences fully conforming <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>
76       sequences, include:
77     </p>
78 <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">mpl</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
79 </pre>
80 <p>
81       If you want bi-directional adaptation to and from <a href="http://www.boost.org/libs/mpl/index.html" target="_top">MPL</a>
82       and Fusion, simply include:
83     </p>
84 <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">include</span><span class="special">/</span><span class="identifier">mpl</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
85 </pre>
86 <p>
87       The header includes all the necessary headers.
88     </p>
89 </div>
90 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
91 <td align="left"></td>
92 <td align="right"><div class="copyright-footer">Copyright &#169; 2001-2006, 2011, 2012 Joel de Guzman,
93       Dan Marsden, Tobias Schwinger<p>
94         Distributed under the Boost Software License, Version 1.0. (See accompanying
95         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>)
96       </p>
97 </div></td>
98 </tr></table>
99 <hr>
100 <div class="spirit-nav">
101 <a accesskey="p" href="view/repetitive_view.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="adapted/array.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
102 </div>
103 </body>
104 </html>