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>
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>.
24 <type><classname>proto::callable</classname></type>
26 <struct-specialization name="result">
28 <template-type-parameter name="This"/>
29 <template-type-parameter name="Expr"/>
32 <template-arg>This(Expr)</template-arg>
36 <classname>proto::result_of::flatten</classname><
37 typename boost::remove_reference< Expr >::type
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>< Expr const >::type</type>
45 <template-type-parameter name="Expr"/>
47 <parameter name="expr">
48 <paramtype>Expr const &</paramtype>
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>
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<></classname></computeroutput>
66 transform; that is, fold all but the first child.
70 <type><classname>proto::callable</classname></type>
72 <struct-specialization name="result">
74 <template-type-parameter name="This"/>
75 <template-type-parameter name="Expr"/>
78 <template-arg>This(Expr)</template-arg>
82 fusion::result_of::pop_front<
83 typename boost::remove_reference< Expr >::type const
86 </struct-specialization>
87 <method-group name="public member functions">
88 <method name="operator()" cv="const">
89 <type>typename fusion::result_of::pop_front< Expr const >::type</type>
91 <template-type-parameter name="Expr"/>
93 <parameter name="expr">
94 <paramtype>Expr const &</paramtype>
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.
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.
115 <type><classname>proto::callable</classname></type>
117 <struct-specialization name="result">
119 <template-type-parameter name="This"/>
120 <template-type-parameter name="Expr"/>
123 <template-arg>This(Expr)</template-arg>
127 fusion::result_of::reverse<
128 typename boost::remove_reference< Expr >::type const
131 </struct-specialization>
132 <method-group name="public member functions">
133 <method name="operator()" cv="const">
134 <type>typename fusion::result_of::reverse< Expr const >::type</type>
136 <template-type-parameter name="Expr"/>
138 <parameter name="expr">
139 <paramtype>Expr const &</paramtype>
146 <namespace name="result_of">
147 <!-- proto::result_of::flatten -->
148 <struct name="flatten">
150 <template-type-parameter name="Expr"/>
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>
160 <!-- proto::flatten() -->
161 <function name="flatten">
162 <type>typename <classname>proto::result_of::flatten</classname>< Expr const >::type</type>
164 <template-type-parameter name="Expr"/>
166 <parameter name="expr">
167 <paramtype>Expr const &</paramtype>
169 <purpose>A function that returns a "flattened" view of a Proto expression tree. </purpose>
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>.