]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | // (C) Copyright Tobias Schwinger | |
3 | // | |
4 | // Use modification and distribution are subject to the boost Software License, | |
5 | // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). | |
6 | ||
7 | //------------------------------------------------------------------------------ | |
8 | ||
9 | // no include guards, this file is intended for multiple inclusion | |
10 | ||
11 | // input: BOOST_FT_syntax type macro to use | |
12 | // input: BOOST_FT_cc empty or cc specifier | |
13 | // input: BOOST_FT_ell empty or "..." | |
14 | // input: BOOST_FT_cv empty or cv qualifiers | |
15 | // input: BOOST_FT_flags single decimal integer encoding the flags | |
16 | // output: BOOST_FT_n number of component types (arity+1) | |
17 | // output: BOOST_FT_arity current arity | |
18 | // output: BOOST_FT_type macro that expands to the type | |
19 | // output: BOOST_FT_tplargs(p) template arguments with given prefix | |
20 | // output: BOOST_FT_params(p) parameters with given prefix | |
21 | ||
22 | # define BOOST_FT_make_type(flags,cc,arity) BOOST_FT_make_type_impl(flags,cc,arity) | |
23 | # define BOOST_FT_make_type_impl(flags,cc,arity) make_type_ ## flags ## _ ## cc ## _ ## arity | |
24 | template< typename R > | |
25 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,0) | |
26 | { | |
27 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (BOOST_FT_nullary_param BOOST_FT_ell) BOOST_FT_cv ; | |
28 | }; | |
29 | template< > | |
30 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 1 > | |
31 | { | |
32 | template<typename S> struct synthesize_impl_i | |
33 | { | |
34 | private: | |
35 | typedef typename mpl::begin<S> ::type iter_0; | |
36 | public: | |
37 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,0) | |
38 | < typename mpl::deref< iter_0 > ::type | |
39 | > ::type type; | |
40 | }; | |
41 | }; | |
42 | template< typename R , typename T0 > | |
43 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,1) | |
44 | { | |
45 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 BOOST_FT_ell) BOOST_FT_cv ; | |
46 | }; | |
47 | template< > | |
48 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 2 > | |
49 | { | |
50 | template<typename S> struct synthesize_impl_i | |
51 | { | |
52 | private: | |
53 | typedef typename mpl::begin<S> ::type iter_0; | |
54 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
55 | public: | |
56 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,1) | |
57 | < typename mpl::deref< iter_0 > ::type | |
58 | , typename mpl::deref< iter_1 > ::type | |
59 | > ::type type; | |
60 | }; | |
61 | }; | |
62 | template< typename R , typename T0 , typename T1 > | |
63 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,2) | |
64 | { | |
65 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 BOOST_FT_ell) BOOST_FT_cv ; | |
66 | }; | |
67 | template< > | |
68 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 3 > | |
69 | { | |
70 | template<typename S> struct synthesize_impl_i | |
71 | { | |
72 | private: | |
73 | typedef typename mpl::begin<S> ::type iter_0; | |
74 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
75 | typedef typename mpl::next< iter_1 > ::type iter_2; | |
76 | public: | |
77 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,2) | |
78 | < typename mpl::deref< iter_0 > ::type | |
79 | , typename mpl::deref< iter_1 > ::type | |
80 | , typename mpl::deref< iter_2 > ::type | |
81 | > ::type type; | |
82 | }; | |
83 | }; | |
84 | template< typename R , typename T0 , typename T1 , typename T2 > | |
85 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,3) | |
86 | { | |
87 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 BOOST_FT_ell) BOOST_FT_cv ; | |
88 | }; | |
89 | template< > | |
90 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 4 > | |
91 | { | |
92 | template<typename S> struct synthesize_impl_i | |
93 | { | |
94 | private: | |
95 | typedef typename mpl::begin<S> ::type iter_0; | |
96 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
97 | typedef typename mpl::next< iter_1 > ::type iter_2; | |
98 | typedef typename mpl::next< iter_2 > ::type iter_3; | |
99 | public: | |
100 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,3) | |
101 | < typename mpl::deref< iter_0 > ::type | |
102 | , typename mpl::deref< iter_1 > ::type | |
103 | , typename mpl::deref< iter_2 > ::type | |
104 | , typename mpl::deref< iter_3 > ::type | |
105 | > ::type type; | |
106 | }; | |
107 | }; | |
108 | template< typename R , typename T0 , typename T1 , typename T2 , typename T3 > | |
109 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,4) | |
110 | { | |
111 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 BOOST_FT_ell) BOOST_FT_cv ; | |
112 | }; | |
113 | template< > | |
114 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 5 > | |
115 | { | |
116 | template<typename S> struct synthesize_impl_i | |
117 | { | |
118 | private: | |
119 | typedef typename mpl::begin<S> ::type iter_0; | |
120 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
121 | typedef typename mpl::next< iter_1 > ::type iter_2; | |
122 | typedef typename mpl::next< iter_2 > ::type iter_3; | |
123 | typedef typename mpl::next< iter_3 > ::type iter_4; | |
124 | public: | |
125 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,4) | |
126 | < typename mpl::deref< iter_0 > ::type | |
127 | , typename mpl::deref< iter_1 > ::type | |
128 | , typename mpl::deref< iter_2 > ::type | |
129 | , typename mpl::deref< iter_3 > ::type | |
130 | , typename mpl::deref< iter_4 > ::type | |
131 | > ::type type; | |
132 | }; | |
133 | }; | |
134 | template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 > | |
135 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,5) | |
136 | { | |
137 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 BOOST_FT_ell) BOOST_FT_cv ; | |
138 | }; | |
139 | template< > | |
140 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 6 > | |
141 | { | |
142 | template<typename S> struct synthesize_impl_i | |
143 | { | |
144 | private: | |
145 | typedef typename mpl::begin<S> ::type iter_0; | |
146 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
147 | typedef typename mpl::next< iter_1 > ::type iter_2; | |
148 | typedef typename mpl::next< iter_2 > ::type iter_3; | |
149 | typedef typename mpl::next< iter_3 > ::type iter_4; | |
150 | typedef typename mpl::next< iter_4 > ::type iter_5; | |
151 | public: | |
152 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,5) | |
153 | < typename mpl::deref< iter_0 > ::type | |
154 | , typename mpl::deref< iter_1 > ::type | |
155 | , typename mpl::deref< iter_2 > ::type | |
156 | , typename mpl::deref< iter_3 > ::type | |
157 | , typename mpl::deref< iter_4 > ::type | |
158 | , typename mpl::deref< iter_5 > ::type | |
159 | > ::type type; | |
160 | }; | |
161 | }; | |
162 | template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > | |
163 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,6) | |
164 | { | |
165 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 BOOST_FT_ell) BOOST_FT_cv ; | |
166 | }; | |
167 | template< > | |
168 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 7 > | |
169 | { | |
170 | template<typename S> struct synthesize_impl_i | |
171 | { | |
172 | private: | |
173 | typedef typename mpl::begin<S> ::type iter_0; | |
174 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
175 | typedef typename mpl::next< iter_1 > ::type iter_2; | |
176 | typedef typename mpl::next< iter_2 > ::type iter_3; | |
177 | typedef typename mpl::next< iter_3 > ::type iter_4; | |
178 | typedef typename mpl::next< iter_4 > ::type iter_5; | |
179 | typedef typename mpl::next< iter_5 > ::type iter_6; | |
180 | public: | |
181 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,6) | |
182 | < typename mpl::deref< iter_0 > ::type | |
183 | , typename mpl::deref< iter_1 > ::type | |
184 | , typename mpl::deref< iter_2 > ::type | |
185 | , typename mpl::deref< iter_3 > ::type | |
186 | , typename mpl::deref< iter_4 > ::type | |
187 | , typename mpl::deref< iter_5 > ::type | |
188 | , typename mpl::deref< iter_6 > ::type | |
189 | > ::type type; | |
190 | }; | |
191 | }; | |
192 | template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > | |
193 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,7) | |
194 | { | |
195 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 BOOST_FT_ell) BOOST_FT_cv ; | |
196 | }; | |
197 | template< > | |
198 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 8 > | |
199 | { | |
200 | template<typename S> struct synthesize_impl_i | |
201 | { | |
202 | private: | |
203 | typedef typename mpl::begin<S> ::type iter_0; | |
204 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
205 | typedef typename mpl::next< iter_1 > ::type iter_2; | |
206 | typedef typename mpl::next< iter_2 > ::type iter_3; | |
207 | typedef typename mpl::next< iter_3 > ::type iter_4; | |
208 | typedef typename mpl::next< iter_4 > ::type iter_5; | |
209 | typedef typename mpl::next< iter_5 > ::type iter_6; | |
210 | typedef typename mpl::next< iter_6 > ::type iter_7; | |
211 | public: | |
212 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,7) | |
213 | < typename mpl::deref< iter_0 > ::type | |
214 | , typename mpl::deref< iter_1 > ::type | |
215 | , typename mpl::deref< iter_2 > ::type | |
216 | , typename mpl::deref< iter_3 > ::type | |
217 | , typename mpl::deref< iter_4 > ::type | |
218 | , typename mpl::deref< iter_5 > ::type | |
219 | , typename mpl::deref< iter_6 > ::type | |
220 | , typename mpl::deref< iter_7 > ::type | |
221 | > ::type type; | |
222 | }; | |
223 | }; | |
224 | template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 > | |
225 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,8) | |
226 | { | |
227 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 BOOST_FT_ell) BOOST_FT_cv ; | |
228 | }; | |
229 | template< > | |
230 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 9 > | |
231 | { | |
232 | template<typename S> struct synthesize_impl_i | |
233 | { | |
234 | private: | |
235 | typedef typename mpl::begin<S> ::type iter_0; | |
236 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
237 | typedef typename mpl::next< iter_1 > ::type iter_2; | |
238 | typedef typename mpl::next< iter_2 > ::type iter_3; | |
239 | typedef typename mpl::next< iter_3 > ::type iter_4; | |
240 | typedef typename mpl::next< iter_4 > ::type iter_5; | |
241 | typedef typename mpl::next< iter_5 > ::type iter_6; | |
242 | typedef typename mpl::next< iter_6 > ::type iter_7; | |
243 | typedef typename mpl::next< iter_7 > ::type iter_8; | |
244 | public: | |
245 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,8) | |
246 | < typename mpl::deref< iter_0 > ::type | |
247 | , typename mpl::deref< iter_1 > ::type | |
248 | , typename mpl::deref< iter_2 > ::type | |
249 | , typename mpl::deref< iter_3 > ::type | |
250 | , typename mpl::deref< iter_4 > ::type | |
251 | , typename mpl::deref< iter_5 > ::type | |
252 | , typename mpl::deref< iter_6 > ::type | |
253 | , typename mpl::deref< iter_7 > ::type | |
254 | , typename mpl::deref< iter_8 > ::type | |
255 | > ::type type; | |
256 | }; | |
257 | }; | |
258 | template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 > | |
259 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,9) | |
260 | { | |
261 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 BOOST_FT_ell) BOOST_FT_cv ; | |
262 | }; | |
263 | template< > | |
264 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 10 > | |
265 | { | |
266 | template<typename S> struct synthesize_impl_i | |
267 | { | |
268 | private: | |
269 | typedef typename mpl::begin<S> ::type iter_0; | |
270 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
271 | typedef typename mpl::next< iter_1 > ::type iter_2; | |
272 | typedef typename mpl::next< iter_2 > ::type iter_3; | |
273 | typedef typename mpl::next< iter_3 > ::type iter_4; | |
274 | typedef typename mpl::next< iter_4 > ::type iter_5; | |
275 | typedef typename mpl::next< iter_5 > ::type iter_6; | |
276 | typedef typename mpl::next< iter_6 > ::type iter_7; | |
277 | typedef typename mpl::next< iter_7 > ::type iter_8; | |
278 | typedef typename mpl::next< iter_8 > ::type iter_9; | |
279 | public: | |
280 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,9) | |
281 | < typename mpl::deref< iter_0 > ::type | |
282 | , typename mpl::deref< iter_1 > ::type | |
283 | , typename mpl::deref< iter_2 > ::type | |
284 | , typename mpl::deref< iter_3 > ::type | |
285 | , typename mpl::deref< iter_4 > ::type | |
286 | , typename mpl::deref< iter_5 > ::type | |
287 | , typename mpl::deref< iter_6 > ::type | |
288 | , typename mpl::deref< iter_7 > ::type | |
289 | , typename mpl::deref< iter_8 > ::type | |
290 | , typename mpl::deref< iter_9 > ::type | |
291 | > ::type type; | |
292 | }; | |
293 | }; | |
294 | template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 > | |
295 | struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,10) | |
296 | { | |
297 | typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 BOOST_FT_ell) BOOST_FT_cv ; | |
298 | }; | |
299 | template< > | |
300 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 11 > | |
301 | { | |
302 | template<typename S> struct synthesize_impl_i | |
303 | { | |
304 | private: | |
305 | typedef typename mpl::begin<S> ::type iter_0; | |
306 | typedef typename mpl::next< iter_0 > ::type iter_1; | |
307 | typedef typename mpl::next< iter_1 > ::type iter_2; | |
308 | typedef typename mpl::next< iter_2 > ::type iter_3; | |
309 | typedef typename mpl::next< iter_3 > ::type iter_4; | |
310 | typedef typename mpl::next< iter_4 > ::type iter_5; | |
311 | typedef typename mpl::next< iter_5 > ::type iter_6; | |
312 | typedef typename mpl::next< iter_6 > ::type iter_7; | |
313 | typedef typename mpl::next< iter_7 > ::type iter_8; | |
314 | typedef typename mpl::next< iter_8 > ::type iter_9; | |
315 | typedef typename mpl::next< iter_9 > ::type iter_10; | |
316 | public: | |
317 | typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,10) | |
318 | < typename mpl::deref< iter_0 > ::type | |
319 | , typename mpl::deref< iter_1 > ::type | |
320 | , typename mpl::deref< iter_2 > ::type | |
321 | , typename mpl::deref< iter_3 > ::type | |
322 | , typename mpl::deref< iter_4 > ::type | |
323 | , typename mpl::deref< iter_5 > ::type | |
324 | , typename mpl::deref< iter_6 > ::type | |
325 | , typename mpl::deref< iter_7 > ::type | |
326 | , typename mpl::deref< iter_8 > ::type | |
327 | , typename mpl::deref< iter_9 > ::type | |
328 | , typename mpl::deref< iter_10 > ::type | |
329 | > ::type type; | |
330 | }; | |
331 | }; | |
332 | # undef BOOST_FT_make_type | |
333 | # undef BOOST_FT_make_type_impl | |
334 |