3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>Class templates for type decomposition
</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 1. Boost.FunctionTypes 2.5">
8 <link rel=
"up" href=
"../reference.html" title=
"Reference">
9 <link rel=
"prev" href=
"classification.html" title=
"Class templates for type classification">
10 <link rel=
"next" href=
"synthesis.html" title=
"Class templates for type synthesis">
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>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"classification.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../reference.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=
"synthesis.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>
26 <div class=
"titlepage"><div><div><h3 class=
"title">
27 <a name=
"boost_functiontypes.reference.decomposition"></a><a class=
"link" href=
"decomposition.html" title=
"Class templates for type decomposition">Class templates
28 for type decomposition
</a>
29 </h3></div></div></div>
31 <dt><span class=
"section"><a href=
"decomposition.html#boost_functiontypes.reference.decomposition.result_type">result_type
</a></span></dt>
32 <dt><span class=
"section"><a href=
"decomposition.html#boost_functiontypes.reference.decomposition.parameter_types">parameter_types
</a></span></dt>
33 <dt><span class=
"section"><a href=
"decomposition.html#boost_functiontypes.reference.decomposition.function_arity">function_arity
</a></span></dt>
34 <dt><span class=
"section"><a href=
"decomposition.html#boost_functiontypes.reference.decomposition.components">components
</a></span></dt>
37 <div class=
"titlepage"><div><div><h4 class=
"title">
38 <a name=
"boost_functiontypes.reference.decomposition.result_type"></a><a class=
"link" href=
"decomposition.html#boost_functiontypes.reference.decomposition.result_type" title=
"result_type">result_type
</a>
39 </h4></div></div></div>
40 <pre class=
"programlisting"><span class=
"keyword">template
</span><span class=
"special"><</span><span class=
"keyword">typename
</span> <span class=
"identifier">F
</span><span class=
"special">></span>
41 <span class=
"keyword">struct
</span> <span class=
"identifier">result_type
</span><span class=
"special">;
</span>
44 <span class=
"bold"><strong>Header
</strong></span>
46 <pre class=
"programlisting"><span class=
"preprocessor">#include
</span> <span class=
"special"><</span><span class=
"identifier">boost
</span><span class=
"special">/
</span><span class=
"identifier">function_types
</span><span class=
"special">/
</span><span class=
"identifier">result_type
</span><span class=
"special">.
</span><span class=
"identifier">hpp
</span><span class=
"special">></span>
48 <div class=
"variablelist">
49 <p class=
"title"><b></b></p>
51 <dt><span class=
"term"><code class=
"literal">F
</code></span></dt>
55 <dt><span class=
"term"><code class=
"literal">result_type
<F
>::type
</code></span></dt>
57 Result type of
<code class=
"literal">F
</code>
62 Extracts the result type of a callable, builtin type.
65 If
<code class=
"literal">F
</code> is no callable, builtin type, any attempt to access
66 the
<code class=
"literal">type
</code> member results in a compile error.
70 <div class=
"titlepage"><div><div><h4 class=
"title">
71 <a name=
"boost_functiontypes.reference.decomposition.parameter_types"></a><a class=
"link" href=
"decomposition.html#boost_functiontypes.reference.decomposition.parameter_types" title=
"parameter_types">parameter_types
</a>
72 </h4></div></div></div>
73 <pre class=
"programlisting"><span class=
"keyword">template
</span><span class=
"special"><</span><span class=
"keyword">typename
</span> <span class=
"identifier">F
</span><span class=
"special">,
</span> <span class=
"keyword">class
</span> <span class=
"identifier">ClassTransform
</span> <span class=
"special">=
</span> <span class=
"identifier">add_reference
</span><span class=
"special"><</span><span class=
"identifier">_
</span><span class=
"special">></span> <span class=
"special">></span>
74 <span class=
"keyword">struct
</span> <span class=
"identifier">parameter_types
</span><span class=
"special">;
</span>
77 <span class=
"bold"><strong>Header
</strong></span>
79 <pre class=
"programlisting"><span class=
"preprocessor">#include
</span> <span class=
"special"><</span><span class=
"identifier">boost
</span><span class=
"special">/
</span><span class=
"identifier">function_types
</span><span class=
"special">/
</span><span class=
"identifier">parameter_types
</span><span class=
"special">.
</span><span class=
"identifier">hpp
</span><span class=
"special">></span>
81 <div class=
"variablelist">
82 <p class=
"title"><b></b></p>
84 <dt><span class=
"term"><code class=
"literal">F
</code></span></dt>
88 <dt><span class=
"term"><code class=
"literal">ClassTransform
</code></span></dt>
90 <a href=
"../../../../../mpl/index.html" target=
"_top">MPL
</a> -
<a href=
"../../../../../mpl/doc/refmanual/lambda-expression.html" target=
"_top">Lambda
91 Expression
</a> to transform the class type if
<code class=
"literal">F
</code>
92 is a member function pointer
94 <dt><span class=
"term"><code class=
"literal">parameter_types
<F,ClassTransform
></code></span></dt>
96 <a href=
"../../../../../mpl/index.html" target=
"_top">MPL
</a> -
<a href=
"../../../../../mpl/doc/refmanual/front-extensible-sequence.html" target=
"_top">Front
</a>
97 /
<a href=
"../../../../../mpl/doc/refmanual/back-extensible-sequence.html" target=
"_top">Back
98 </a><a href=
"../../../../../mpl/doc/refmanual/extensible-sequence.html" target=
"_top">Extensible
99 </a><a href=
"../../../../../mpl/doc/refmanual/random-access-sequence.html" target=
"_top">Random
100 Access Sequence
</a> of parameter types
105 Extracts the parameter types of a callable, builtin type.
108 If
<code class=
"literal">F
</code> is no callable, builtin type, any attempt to access
109 the sequence results in a compile error.
112 <div class=
"section">
113 <div class=
"titlepage"><div><div><h4 class=
"title">
114 <a name=
"boost_functiontypes.reference.decomposition.function_arity"></a><a class=
"link" href=
"decomposition.html#boost_functiontypes.reference.decomposition.function_arity" title=
"function_arity">function_arity
</a>
115 </h4></div></div></div>
116 <pre class=
"programlisting"><span class=
"keyword">template
</span><span class=
"special"><</span><span class=
"keyword">typename
</span> <span class=
"identifier">F
</span><span class=
"special">></span>
117 <span class=
"keyword">struct
</span> <span class=
"identifier">function_arity
</span><span class=
"special">;
</span>
120 <span class=
"bold"><strong>Header
</strong></span>
122 <pre class=
"programlisting"><span class=
"preprocessor">#include
</span> <span class=
"special"><</span><span class=
"identifier">boost
</span><span class=
"special">/
</span><span class=
"identifier">function_types
</span><span class=
"special">/
</span><span class=
"identifier">function_arity
</span><span class=
"special">.
</span><span class=
"identifier">hpp
</span><span class=
"special">></span>
124 <div class=
"variablelist">
125 <p class=
"title"><b></b></p>
127 <dt><span class=
"term"><code class=
"literal">F
</code></span></dt>
129 Callable builtin type
131 <dt><span class=
"term"><code class=
"literal">function_arity
<F
></code></span></dt>
133 Function arity as
<a href=
"../../../../../mpl/index.html" target=
"_top">MPL
</a>
134 -
<a href=
"../../../../../mpl/doc/refmanual/integral-constant.html" target=
"_top">Integral
137 <dt><span class=
"term"><code class=
"literal">function_arity
<F
>::value
</code></span></dt>
139 Constant value of the function arity
144 Extracts the function arity, that is the number of parameters. The hidden
145 <code class=
"literal">this
</code> of member function pointers counts, in other words
146 the arity value is always greater than or equal to one if
<code class=
"literal">F
</code>
147 is a member function pointer.
150 If
<code class=
"literal">F
</code> is no callable, builtin type, any attempt to access
151 the value results in a compile error.
154 <div class=
"section">
155 <div class=
"titlepage"><div><div><h4 class=
"title">
156 <a name=
"boost_functiontypes.reference.decomposition.components"></a><a class=
"link" href=
"decomposition.html#boost_functiontypes.reference.decomposition.components" title=
"components">components
</a>
157 </h4></div></div></div>
158 <pre class=
"programlisting"><span class=
"keyword">template
</span><span class=
"special"><</span><span class=
"keyword">typename
</span> <span class=
"identifier">T
</span><span class=
"special">,
</span> <span class=
"keyword">class
</span> <span class=
"identifier">ClassTransform
</span> <span class=
"special">=
</span> <span class=
"identifier">add_reference
</span><span class=
"special"><</span><span class=
"identifier">_
</span><span class=
"special">></span> <span class=
"special">></span>
159 <span class=
"keyword">struct
</span> <span class=
"identifier">components
</span><span class=
"special">;
</span>
162 <span class=
"bold"><strong>Header
</strong></span>
164 <pre class=
"programlisting"><span class=
"preprocessor">#include
</span> <span class=
"special"><</span><span class=
"identifier">boost
</span><span class=
"special">/
</span><span class=
"identifier">function_types
</span><span class=
"special">/
</span><span class=
"identifier">components
</span><span class=
"special">.
</span><span class=
"identifier">hpp
</span><span class=
"special">></span>
166 <div class=
"variablelist">
167 <p class=
"title"><b></b></p>
169 <dt><span class=
"term"><code class=
"literal">T
</code></span></dt>
173 <dt><span class=
"term"><code class=
"literal">ClassTransform
</code></span></dt>
175 <a href=
"../../../../../mpl/index.html" target=
"_top">MPL
</a> -
<a href=
"../../../../../mpl/doc/refmanual/lambda-expression.html" target=
"_top">Lambda
176 Expression
</a> to transform the class type if
<code class=
"literal">T
</code>
177 is a member function pointer
179 <dt><span class=
"term"><code class=
"literal">components
<T,ClassTransform
></code></span></dt>
181 <a href=
"../../../../../mpl/index.html" target=
"_top">MPL
</a> -
<a href=
"../../../../../mpl/doc/refmanual/front-extensible-sequence.html" target=
"_top">Front
</a>
182 /
<a href=
"../../../../../mpl/doc/refmanual/back-extensible-sequence.html" target=
"_top">Back
183 </a><a href=
"../../../../../mpl/doc/refmanual/extensible-sequence.html" target=
"_top">Extensible
184 </a><a href=
"../../../../../mpl/doc/refmanual/random-access-sequence.html" target=
"_top">Random
185 Access Sequence
</a> of all component types and property tag
187 <dt><span class=
"term"><code class=
"literal">components
<T,ClassTransform
>::types
</code></span></dt>
189 Decorated MPL Sequence, exposed for optimization
194 Extracts all properties of a callable builtin type, that is the result
195 type, followed by the parameter types (including the type of
<code class=
"literal">this
</code>
196 for member function pointers).
199 If
<code class=
"literal">T
</code> is no callable builtin type, the component types
200 are an empty sequence and the Tag's meaning is equivalent to the
<code class=
"literal"><a class=
"link" href=
"tag_types.html#boost_functiontypes.reference.tag_types.null_tag" title=
"null_tag">null_tag
</a></code>.
204 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
205 <td align=
"left"></td>
206 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2004-
2007 Tobias
208 Distributed under the Boost Software License, Version
1.0. (See accompanying
209 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>)
214 <div class=
"spirit-nav">
215 <a accesskey=
"p" href=
"classification.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../reference.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=
"synthesis.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>