blob: bbd5963fa0ea0d2df819820129c63f869a6f8773 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
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
24template< typename R , typename T0 >
25struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,1)
26{
27typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) ( BOOST_FT_ell) BOOST_FT_cv ;
28};
29template< >
30struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 2 >
31{
32template<typename S> struct synthesize_impl_i
33{
34private:
35typedef typename mpl::begin<S> ::type iter_0;
36typedef typename mpl::next< iter_0 > ::type iter_1;
37public:
38typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,1)
39< typename mpl::deref< iter_0 > ::type
40, typename detail::cv_traits<
41typename mpl::deref< iter_1 > ::type > ::type
42> ::type type;
43};
44};
45template< typename R , typename T0 , typename T1 >
46struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,2)
47{
48typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 BOOST_FT_ell) BOOST_FT_cv ;
49};
50template< >
51struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 3 >
52{
53template<typename S> struct synthesize_impl_i
54{
55private:
56typedef typename mpl::begin<S> ::type iter_0;
57typedef typename mpl::next< iter_0 > ::type iter_1;
58typedef typename mpl::next< iter_1 > ::type iter_2;
59public:
60typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,2)
61< typename mpl::deref< iter_0 > ::type
62, typename detail::cv_traits<
63typename mpl::deref< iter_1 > ::type > ::type
64, typename mpl::deref< iter_2 > ::type
65> ::type type;
66};
67};
68template< typename R , typename T0 , typename T1 , typename T2 >
69struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,3)
70{
71typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 BOOST_FT_ell) BOOST_FT_cv ;
72};
73template< >
74struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 4 >
75{
76template<typename S> struct synthesize_impl_i
77{
78private:
79typedef typename mpl::begin<S> ::type iter_0;
80typedef typename mpl::next< iter_0 > ::type iter_1;
81typedef typename mpl::next< iter_1 > ::type iter_2;
82typedef typename mpl::next< iter_2 > ::type iter_3;
83public:
84typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,3)
85< typename mpl::deref< iter_0 > ::type
86, typename detail::cv_traits<
87typename mpl::deref< iter_1 > ::type > ::type
88, typename mpl::deref< iter_2 > ::type
89, typename mpl::deref< iter_3 > ::type
90> ::type type;
91};
92};
93template< typename R , typename T0 , typename T1 , typename T2 , typename T3 >
94struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,4)
95{
96typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 BOOST_FT_ell) BOOST_FT_cv ;
97};
98template< >
99struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 5 >
100{
101template<typename S> struct synthesize_impl_i
102{
103private:
104typedef typename mpl::begin<S> ::type iter_0;
105typedef typename mpl::next< iter_0 > ::type iter_1;
106typedef typename mpl::next< iter_1 > ::type iter_2;
107typedef typename mpl::next< iter_2 > ::type iter_3;
108typedef typename mpl::next< iter_3 > ::type iter_4;
109public:
110typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,4)
111< typename mpl::deref< iter_0 > ::type
112, typename detail::cv_traits<
113typename mpl::deref< iter_1 > ::type > ::type
114, typename mpl::deref< iter_2 > ::type
115, typename mpl::deref< iter_3 > ::type
116, typename mpl::deref< iter_4 > ::type
117> ::type type;
118};
119};
120template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 >
121struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,5)
122{
123typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 BOOST_FT_ell) BOOST_FT_cv ;
124};
125template< >
126struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 6 >
127{
128template<typename S> struct synthesize_impl_i
129{
130private:
131typedef typename mpl::begin<S> ::type iter_0;
132typedef typename mpl::next< iter_0 > ::type iter_1;
133typedef typename mpl::next< iter_1 > ::type iter_2;
134typedef typename mpl::next< iter_2 > ::type iter_3;
135typedef typename mpl::next< iter_3 > ::type iter_4;
136typedef typename mpl::next< iter_4 > ::type iter_5;
137public:
138typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,5)
139< typename mpl::deref< iter_0 > ::type
140, typename detail::cv_traits<
141typename mpl::deref< iter_1 > ::type > ::type
142, typename mpl::deref< iter_2 > ::type
143, typename mpl::deref< iter_3 > ::type
144, typename mpl::deref< iter_4 > ::type
145, typename mpl::deref< iter_5 > ::type
146> ::type type;
147};
148};
149template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
150struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,6)
151{
152typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 BOOST_FT_ell) BOOST_FT_cv ;
153};
154template< >
155struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 7 >
156{
157template<typename S> struct synthesize_impl_i
158{
159private:
160typedef typename mpl::begin<S> ::type iter_0;
161typedef typename mpl::next< iter_0 > ::type iter_1;
162typedef typename mpl::next< iter_1 > ::type iter_2;
163typedef typename mpl::next< iter_2 > ::type iter_3;
164typedef typename mpl::next< iter_3 > ::type iter_4;
165typedef typename mpl::next< iter_4 > ::type iter_5;
166typedef typename mpl::next< iter_5 > ::type iter_6;
167public:
168typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,6)
169< typename mpl::deref< iter_0 > ::type
170, typename detail::cv_traits<
171typename mpl::deref< iter_1 > ::type > ::type
172, typename mpl::deref< iter_2 > ::type
173, typename mpl::deref< iter_3 > ::type
174, typename mpl::deref< iter_4 > ::type
175, typename mpl::deref< iter_5 > ::type
176, typename mpl::deref< iter_6 > ::type
177> ::type type;
178};
179};
180template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
181struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,7)
182{
183typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 BOOST_FT_ell) BOOST_FT_cv ;
184};
185template< >
186struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 8 >
187{
188template<typename S> struct synthesize_impl_i
189{
190private:
191typedef typename mpl::begin<S> ::type iter_0;
192typedef typename mpl::next< iter_0 > ::type iter_1;
193typedef typename mpl::next< iter_1 > ::type iter_2;
194typedef typename mpl::next< iter_2 > ::type iter_3;
195typedef typename mpl::next< iter_3 > ::type iter_4;
196typedef typename mpl::next< iter_4 > ::type iter_5;
197typedef typename mpl::next< iter_5 > ::type iter_6;
198typedef typename mpl::next< iter_6 > ::type iter_7;
199public:
200typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,7)
201< typename mpl::deref< iter_0 > ::type
202, typename detail::cv_traits<
203typename mpl::deref< iter_1 > ::type > ::type
204, typename mpl::deref< iter_2 > ::type
205, typename mpl::deref< iter_3 > ::type
206, typename mpl::deref< iter_4 > ::type
207, typename mpl::deref< iter_5 > ::type
208, typename mpl::deref< iter_6 > ::type
209, typename mpl::deref< iter_7 > ::type
210> ::type type;
211};
212};
213template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 >
214struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,8)
215{
216typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 BOOST_FT_ell) BOOST_FT_cv ;
217};
218template< >
219struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 9 >
220{
221template<typename S> struct synthesize_impl_i
222{
223private:
224typedef typename mpl::begin<S> ::type iter_0;
225typedef typename mpl::next< iter_0 > ::type iter_1;
226typedef typename mpl::next< iter_1 > ::type iter_2;
227typedef typename mpl::next< iter_2 > ::type iter_3;
228typedef typename mpl::next< iter_3 > ::type iter_4;
229typedef typename mpl::next< iter_4 > ::type iter_5;
230typedef typename mpl::next< iter_5 > ::type iter_6;
231typedef typename mpl::next< iter_6 > ::type iter_7;
232typedef typename mpl::next< iter_7 > ::type iter_8;
233public:
234typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,8)
235< typename mpl::deref< iter_0 > ::type
236, typename detail::cv_traits<
237typename mpl::deref< iter_1 > ::type > ::type
238, typename mpl::deref< iter_2 > ::type
239, typename mpl::deref< iter_3 > ::type
240, typename mpl::deref< iter_4 > ::type
241, typename mpl::deref< iter_5 > ::type
242, typename mpl::deref< iter_6 > ::type
243, typename mpl::deref< iter_7 > ::type
244, typename mpl::deref< iter_8 > ::type
245> ::type type;
246};
247};
248template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
249struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,9)
250{
251typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 BOOST_FT_ell) BOOST_FT_cv ;
252};
253template< >
254struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 10 >
255{
256template<typename S> struct synthesize_impl_i
257{
258private:
259typedef typename mpl::begin<S> ::type iter_0;
260typedef typename mpl::next< iter_0 > ::type iter_1;
261typedef typename mpl::next< iter_1 > ::type iter_2;
262typedef typename mpl::next< iter_2 > ::type iter_3;
263typedef typename mpl::next< iter_3 > ::type iter_4;
264typedef typename mpl::next< iter_4 > ::type iter_5;
265typedef typename mpl::next< iter_5 > ::type iter_6;
266typedef typename mpl::next< iter_6 > ::type iter_7;
267typedef typename mpl::next< iter_7 > ::type iter_8;
268typedef typename mpl::next< iter_8 > ::type iter_9;
269public:
270typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,9)
271< typename mpl::deref< iter_0 > ::type
272, typename detail::cv_traits<
273typename mpl::deref< iter_1 > ::type > ::type
274, typename mpl::deref< iter_2 > ::type
275, typename mpl::deref< iter_3 > ::type
276, typename mpl::deref< iter_4 > ::type
277, typename mpl::deref< iter_5 > ::type
278, typename mpl::deref< iter_6 > ::type
279, typename mpl::deref< iter_7 > ::type
280, typename mpl::deref< iter_8 > ::type
281, typename mpl::deref< iter_9 > ::type
282> ::type type;
283};
284};
285template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 >
286struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,10)
287{
288typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 BOOST_FT_ell) BOOST_FT_cv ;
289};
290template< >
291struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 11 >
292{
293template<typename S> struct synthesize_impl_i
294{
295private:
296typedef typename mpl::begin<S> ::type iter_0;
297typedef typename mpl::next< iter_0 > ::type iter_1;
298typedef typename mpl::next< iter_1 > ::type iter_2;
299typedef typename mpl::next< iter_2 > ::type iter_3;
300typedef typename mpl::next< iter_3 > ::type iter_4;
301typedef typename mpl::next< iter_4 > ::type iter_5;
302typedef typename mpl::next< iter_5 > ::type iter_6;
303typedef typename mpl::next< iter_6 > ::type iter_7;
304typedef typename mpl::next< iter_7 > ::type iter_8;
305typedef typename mpl::next< iter_8 > ::type iter_9;
306typedef typename mpl::next< iter_9 > ::type iter_10;
307public:
308typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,10)
309< typename mpl::deref< iter_0 > ::type
310, typename detail::cv_traits<
311typename mpl::deref< iter_1 > ::type > ::type
312, typename mpl::deref< iter_2 > ::type
313, typename mpl::deref< iter_3 > ::type
314, typename mpl::deref< iter_4 > ::type
315, typename mpl::deref< iter_5 > ::type
316, typename mpl::deref< iter_6 > ::type
317, typename mpl::deref< iter_7 > ::type
318, typename mpl::deref< iter_8 > ::type
319, typename mpl::deref< iter_9 > ::type
320, typename mpl::deref< iter_10 > ::type
321> ::type type;
322};
323};
324# undef BOOST_FT_make_type
325# undef BOOST_FT_make_type_impl
326