Release 1.39.0
[boost.git] / Boost_1_39_0 / libs / proto / doc / reference / fusion.xml
blobd80b3d95f2e0ac7ee95eecc9c2aa1dcc0ab81df1
1 <?xml version="1.0" encoding="utf-8"?>
2 <header name="boost/proto/fusion.hpp">
3   <para>Make any Proto expression a valid Fusion sequence </para>
4   <namespace name="boost">
5     <namespace name="proto">
6       <namespace name="functional">
8         <!-- proto::functional::flatten -->
9         <struct name="flatten">
10           <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type that returns a "flattened"
11             view of a Proto expression tree. </purpose>
12           <description>
13             <para>
14               A <conceptname>PolymorphicFunctionObject</conceptname> type that returns a "flattened" view
15               of a Proto expression tree. For a tree with a top-most node tag of type
16               <computeroutput>T</computeroutput>, the elements of the flattened sequence are determined by
17               recursing into each child node with the same tag type and returning those nodes of different
18               type. So for instance, the Proto expression tree corresponding to the expression
19               <computeroutput>a | b | c</computeroutput> has a flattened view with elements [a, b, c], even
20               though the tree is grouped as <computeroutput>((a | b) | c)</computeroutput>.
21             </para>
22           </description>
23           <inherit>
24             <type><classname>proto::callable</classname></type>
25           </inherit>
26           <struct-specialization name="result">
27             <template>
28               <template-type-parameter name="This"/>
29               <template-type-parameter name="Expr"/>
30             </template>
31             <specialization>
32               <template-arg>This(Expr)</template-arg>
33             </specialization>
34             <inherit>
35               <type>
36     <classname>proto::result_of::flatten</classname>&lt;
37       typename boost::remove_reference&lt; Expr &gt;::type
38     &gt;</type>
39             </inherit>
40           </struct-specialization>
41           <method-group name="public member functions">
42             <method name="operator()" cv="const">
43               <type>typename <classname>proto::result_of::flatten</classname>&lt; Expr const &gt;::type</type>
44               <template>
45                 <template-type-parameter name="Expr"/>
46               </template>
47               <parameter name="expr">
48                 <paramtype>Expr const &amp;</paramtype>
49               </parameter>
50             </method>
51           </method-group>
52         </struct>
54         <!-- proto::functional::pop_front -->
55         <struct name="pop_front">
56           <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes the
57             <computeroutput>fusion::pop_front()</computeroutput> algorithm on its argument.</purpose>
58           <description>
59             <para>
60               A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes the
61               <computeroutput>fusion::pop_front()</computeroutput> algorithm on its argument. This is
62               useful for defining a <conceptname>CallableTransform</conceptname> such as
63               <computeroutput>pop_front(_)</computeroutput>, which removes the first child from a Proto
64               expression node. Such a transform might be used as the first argument to the
65               <computeroutput><classname alt="proto::fold">proto::fold&lt;&gt;</classname></computeroutput>
66               transform; that is, fold all but the first child.
67             </para>
68           </description>
69           <inherit>
70             <type><classname>proto::callable</classname></type>
71           </inherit>
72           <struct-specialization name="result">
73             <template>
74               <template-type-parameter name="This"/>
75               <template-type-parameter name="Expr"/>
76             </template>
77             <specialization>
78               <template-arg>This(Expr)</template-arg>
79             </specialization>
80             <inherit>
81               <type>
82     fusion::result_of::pop_front&lt;
83       typename boost::remove_reference&lt; Expr &gt;::type const
84     &gt;</type>
85             </inherit>
86           </struct-specialization>
87           <method-group name="public member functions">
88             <method name="operator()" cv="const">
89               <type>typename fusion::result_of::pop_front&lt; Expr const  &gt;::type</type>
90               <template>
91                 <template-type-parameter name="Expr"/>
92               </template>
93               <parameter name="expr">
94                 <paramtype>Expr const &amp;</paramtype>
95               </parameter>
96             </method>
97           </method-group>
98         </struct>
100         <!-- proto::functional::reverse -->
101         <struct name="reverse">
102           <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes the
103             <computeroutput>fusion::reverse()</computeroutput> algorithm on its argument.
104           </purpose>
105           <description>
106             <para>
107               A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes the
108               <computeroutput>fusion::reverse()</computeroutput> algorithm on its argument. This is
109               useful for defining a <conceptname>CallableTransform</conceptname> like
110               <computeroutput>reverse(_)</computeroutput>, which reverses the order of the children
111               of a Proto expression node.
112             </para>
113           </description>
114           <inherit>
115             <type><classname>proto::callable</classname></type>
116           </inherit>
117           <struct-specialization name="result">
118             <template>
119               <template-type-parameter name="This"/>
120               <template-type-parameter name="Expr"/>
121             </template>
122             <specialization>
123               <template-arg>This(Expr)</template-arg>
124             </specialization>
125             <inherit>
126               <type>
127     fusion::result_of::reverse&lt;
128       typename boost::remove_reference&lt; Expr &gt;::type const 
129     &gt;</type>
130             </inherit>
131           </struct-specialization>
132           <method-group name="public member functions">
133             <method name="operator()" cv="const">
134               <type>typename fusion::result_of::reverse&lt; Expr const  &gt;::type</type>
135               <template>
136                 <template-type-parameter name="Expr"/>
137               </template>
138               <parameter name="expr">
139                 <paramtype>Expr const &amp;</paramtype>
140               </parameter>
141             </method>
142           </method-group>
143         </struct>
144       </namespace>
145       
146       <namespace name="result_of">
147         <!-- proto::result_of::flatten -->
148         <struct name="flatten">
149           <template>
150             <template-type-parameter name="Expr"/>
151           </template>
152           <purpose>Metafunction that computes the return type of <computeroutput>
153             <functionname alt="proto::flatten">proto::flatten()</functionname></computeroutput></purpose>
154           <typedef name="type">
155             <type><emphasis>unspecified</emphasis></type>
156           </typedef>
157         </struct>
158       </namespace>
160       <!-- proto::flatten() -->
161       <function name="flatten">
162         <type>typename <classname>proto::result_of::flatten</classname>&lt; Expr const &gt;::type</type>
163         <template>
164           <template-type-parameter name="Expr"/>
165         </template>
166         <parameter name="expr">
167           <paramtype>Expr const &amp;</paramtype>
168         </parameter>
169         <purpose>A function that returns a "flattened" view of a Proto expression tree. </purpose>
170         <description>
171           <para>
172             For a tree with a top-most node tag of type <computeroutput>T</computeroutput>, the elements
173             of the flattened sequence are determined by recursing into each child node with the same tag
174             type and returning those nodes of different type. So for instance, the Proto expression tree
175             corresponding to the expression <computeroutput>a | b | c</computeroutput> has a flattened
176             view with elements [a, b, c], even though the tree is grouped as
177             <computeroutput>((a | b) | c)</computeroutput>.
178           </para>
179         </description>
180       </function>
181     </namespace>
182   </namespace>
183 </header>