]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
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"> | |
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="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> | |
24 | </div> | |
25 | <div class="section"> | |
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> | |
30 | <div class="toc"><dl> | |
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> | |
35 | </dl></div> | |
36 | <div class="section"> | |
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> | |
42 | </pre> | |
43 | <p> | |
44 | <span class="bold"><strong>Header</strong></span> | |
45 | </p> | |
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> | |
47 | </pre> | |
48 | <div class="variablelist"> | |
49 | <p class="title"><b></b></p> | |
50 | <dl> | |
51 | <dt><span class="term"><code class="literal">F</code></span></dt> | |
52 | <dd><p> | |
53 | Type to analyze | |
54 | </p></dd> | |
55 | <dt><span class="term"><code class="literal">result_type<F>::type</code></span></dt> | |
56 | <dd><p> | |
57 | Result type of <code class="literal">F</code> | |
58 | </p></dd> | |
59 | </dl> | |
60 | </div> | |
61 | <p> | |
62 | Extracts the result type of a callable, builtin type. | |
63 | </p> | |
64 | <p> | |
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. | |
67 | </p> | |
68 | </div> | |
69 | <div class="section"> | |
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> | |
75 | </pre> | |
76 | <p> | |
77 | <span class="bold"><strong>Header</strong></span> | |
78 | </p> | |
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> | |
80 | </pre> | |
81 | <div class="variablelist"> | |
82 | <p class="title"><b></b></p> | |
83 | <dl> | |
84 | <dt><span class="term"><code class="literal">F</code></span></dt> | |
85 | <dd><p> | |
86 | Type to analyze | |
87 | </p></dd> | |
88 | <dt><span class="term"><code class="literal">ClassTransform</code></span></dt> | |
89 | <dd><p> | |
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 | |
93 | </p></dd> | |
94 | <dt><span class="term"><code class="literal">parameter_types<F,ClassTransform></code></span></dt> | |
95 | <dd><p> | |
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 | |
101 | </p></dd> | |
102 | </dl> | |
103 | </div> | |
104 | <p> | |
105 | Extracts the parameter types of a callable, builtin type. | |
106 | </p> | |
107 | <p> | |
108 | If <code class="literal">F</code> is no callable, builtin type, any attempt to access | |
109 | the sequence results in a compile error. | |
110 | </p> | |
111 | </div> | |
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> | |
118 | </pre> | |
119 | <p> | |
120 | <span class="bold"><strong>Header</strong></span> | |
121 | </p> | |
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> | |
123 | </pre> | |
124 | <div class="variablelist"> | |
125 | <p class="title"><b></b></p> | |
126 | <dl> | |
127 | <dt><span class="term"><code class="literal">F</code></span></dt> | |
128 | <dd><p> | |
129 | Callable builtin type | |
130 | </p></dd> | |
131 | <dt><span class="term"><code class="literal">function_arity<F></code></span></dt> | |
132 | <dd><p> | |
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 | |
135 | Constant</a> | |
136 | </p></dd> | |
137 | <dt><span class="term"><code class="literal">function_arity<F>::value</code></span></dt> | |
138 | <dd><p> | |
139 | Constant value of the function arity | |
140 | </p></dd> | |
141 | </dl> | |
142 | </div> | |
143 | <p> | |
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. | |
148 | </p> | |
149 | <p> | |
150 | If <code class="literal">F</code> is no callable, builtin type, any attempt to access | |
151 | the value results in a compile error. | |
152 | </p> | |
153 | </div> | |
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> | |
160 | </pre> | |
161 | <p> | |
162 | <span class="bold"><strong>Header</strong></span> | |
163 | </p> | |
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> | |
165 | </pre> | |
166 | <div class="variablelist"> | |
167 | <p class="title"><b></b></p> | |
168 | <dl> | |
169 | <dt><span class="term"><code class="literal">T</code></span></dt> | |
170 | <dd><p> | |
171 | Type to analyze | |
172 | </p></dd> | |
173 | <dt><span class="term"><code class="literal">ClassTransform</code></span></dt> | |
174 | <dd><p> | |
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 | |
178 | </p></dd> | |
179 | <dt><span class="term"><code class="literal">components<T,ClassTransform></code></span></dt> | |
180 | <dd><p> | |
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 | |
186 | </p></dd> | |
187 | <dt><span class="term"><code class="literal">components<T,ClassTransform>::types</code></span></dt> | |
188 | <dd><p> | |
189 | Decorated MPL Sequence, exposed for optimization | |
190 | </p></dd> | |
191 | </dl> | |
192 | </div> | |
193 | <p> | |
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). | |
197 | </p> | |
198 | <p> | |
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>. | |
201 | </p> | |
202 | </div> | |
203 | </div> | |
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 | |
207 | Schwinger<p> | |
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>) | |
210 | </p> | |
211 | </div></td> | |
212 | </tr></table> | |
213 | <hr> | |
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> | |
216 | </div> | |
217 | </body> | |
218 | </html> |