arity10_1.hpp 12 KB

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