blob: 8ebb2c8191421c780b48004cbcf92dd0413488fa [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
Jeff Thompson3d613fd2013-10-15 15:39:04 -070011// input: NDNBOOST_FT_syntax type macro to use
12// input: NDNBOOST_FT_cc empty or cc specifier
13// input: NDNBOOST_FT_ell empty or "..."
14// input: NDNBOOST_FT_cv empty or cv qualifiers
15// input: NDNBOOST_FT_flags single decimal integer encoding the flags
16// output: NDNBOOST_FT_n number of component types (arity+1)
17// output: NDNBOOST_FT_arity current arity
18// output: NDNBOOST_FT_type macro that expands to the type
19// output: NDNBOOST_FT_tplargs(p) template arguments with given prefix
20// output: NDNBOOST_FT_params(p) parameters with given prefix
Jeff Thompsona28eed82013-08-22 16:21:10 -070021
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022# define NDNBOOST_FT_make_type(flags,cc,arity) NDNBOOST_FT_make_type_impl(flags,cc,arity)
23# define NDNBOOST_FT_make_type_impl(flags,cc,arity) make_type_ ## flags ## _ ## cc ## _ ## arity
Jeff Thompsona28eed82013-08-22 16:21:10 -070024template< typename R , typename T0 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -070025struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,1)
Jeff Thompsona28eed82013-08-22 16:21:10 -070026{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) ( NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -070028};
29template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -070030struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 2 >
Jeff Thompsona28eed82013-08-22 16:21:10 -070031{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070038typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,1)
Jeff Thompsona28eed82013-08-22 16:21:10 -070039< 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 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -070046struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,2)
Jeff Thompsona28eed82013-08-22 16:21:10 -070047{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070048typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) (T1 NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -070049};
50template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -070051struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 3 >
Jeff Thompsona28eed82013-08-22 16:21:10 -070052{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070060typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,2)
Jeff Thompsona28eed82013-08-22 16:21:10 -070061< 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 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -070069struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,3)
Jeff Thompsona28eed82013-08-22 16:21:10 -070070{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070071typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) (T1 , T2 NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -070072};
73template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -070074struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 4 >
Jeff Thompsona28eed82013-08-22 16:21:10 -070075{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070084typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,3)
Jeff Thompsona28eed82013-08-22 16:21:10 -070085< 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 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -070094struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,4)
Jeff Thompsona28eed82013-08-22 16:21:10 -070095{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070096typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) (T1 , T2 , T3 NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -070097};
98template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -070099struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 5 >
Jeff Thompsona28eed82013-08-22 16:21:10 -0700100{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700110typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,4)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700111< 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 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700121struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,5)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700122{
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700123typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) (T1 , T2 , T3 , T4 NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -0700124};
125template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700126struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 6 >
Jeff Thompsona28eed82013-08-22 16:21:10 -0700127{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700138typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,5)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700139< 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 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700150struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,6)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700151{
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700152typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -0700153};
154template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700155struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 7 >
Jeff Thompsona28eed82013-08-22 16:21:10 -0700156{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700168typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,6)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700169< 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 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700181struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,7)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700182{
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700183typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -0700184};
185template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700186struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 8 >
Jeff Thompsona28eed82013-08-22 16:21:10 -0700187{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700200typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,7)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700201< 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 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700214struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,8)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700215{
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700216typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -0700217};
218template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700219struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 9 >
Jeff Thompsona28eed82013-08-22 16:21:10 -0700220{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700234typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,8)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700235< 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 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700249struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,9)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700250{
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700251typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -0700252};
253template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700254struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 10 >
Jeff Thompsona28eed82013-08-22 16:21:10 -0700255{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700270typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,9)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700271< 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 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700286struct NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,10)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700287{
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700288typedef NDNBOOST_FT_syntax(NDNBOOST_FT_cc,type NDNBOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 NDNBOOST_FT_ell) NDNBOOST_FT_cv ;
Jeff Thompsona28eed82013-08-22 16:21:10 -0700289};
290template< >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700291struct synthesize_impl_o< NDNBOOST_FT_flags, NDNBOOST_FT_cc_id, 11 >
Jeff Thompsona28eed82013-08-22 16:21:10 -0700292{
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:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700308typedef typename detail::NDNBOOST_FT_make_type(NDNBOOST_FT_flags,NDNBOOST_FT_cc_id,10)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700309< 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};
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700324# undef NDNBOOST_FT_make_type
325# undef NDNBOOST_FT_make_type_impl
Jeff Thompsona28eed82013-08-22 16:21:10 -0700326