2 // (C) Copyright Tobias Schwinger
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).
7 //------------------------------------------------------------------------------
9 // no include guards, this file is intended for multiple inclusion
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
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)
27 typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (BOOST_FT_nullary_param BOOST_FT_ell) BOOST_FT_cv ;
30 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 1 >
32 template<typename S> struct synthesize_impl_i
35 typedef typename mpl::begin<S> ::type iter_0;
37 typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,0)
38 < typename mpl::deref< iter_0 > ::type
42 template< typename R , typename T0 >
43 struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,1)
45 typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 BOOST_FT_ell) BOOST_FT_cv ;
48 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 2 >
50 template<typename S> struct synthesize_impl_i
53 typedef typename mpl::begin<S> ::type iter_0;
54 typedef typename mpl::next< iter_0 > ::type iter_1;
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
62 template< typename R , typename T0 , typename T1 >
63 struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,2)
65 typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 BOOST_FT_ell) BOOST_FT_cv ;
68 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 3 >
70 template<typename S> struct synthesize_impl_i
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;
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
84 template< typename R , typename T0 , typename T1 , typename T2 >
85 struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,3)
87 typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 BOOST_FT_ell) BOOST_FT_cv ;
90 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 4 >
92 template<typename S> struct synthesize_impl_i
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;
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
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)
111 typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 BOOST_FT_ell) BOOST_FT_cv ;
114 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 5 >
116 template<typename S> struct synthesize_impl_i
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;
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
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)
137 typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 BOOST_FT_ell) BOOST_FT_cv ;
140 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 6 >
142 template<typename S> struct synthesize_impl_i
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;
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
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)
165 typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 BOOST_FT_ell) BOOST_FT_cv ;
168 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 7 >
170 template<typename S> struct synthesize_impl_i
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;
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
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)
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 ;
198 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 8 >
200 template<typename S> struct synthesize_impl_i
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;
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
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)
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 ;
230 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 9 >
232 template<typename S> struct synthesize_impl_i
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;
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
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)
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 ;
264 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 10 >
266 template<typename S> struct synthesize_impl_i
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;
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
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)
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 ;
300 struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 11 >
302 template<typename S> struct synthesize_impl_i
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;
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
332 # undef BOOST_FT_make_type
333 # undef BOOST_FT_make_type_impl