bind.hpp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. // Copyright Peter Dimov 2001
  2. // Copyright Aleksey Gurtovoy 2001-2004
  3. //
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // *Preprocessed* version of the main "bind.hpp" header
  9. // -- DO NOT modify by hand!
  10. namespace boost { namespace mpl {
  11. namespace aux {
  12. template<
  13. typename T, typename U1, typename U2, typename U3, typename U4
  14. , typename U5
  15. >
  16. struct resolve_bind_arg
  17. {
  18. typedef T type;
  19. };
  20. template<
  21. typename T
  22. , typename Arg
  23. >
  24. struct replace_unnamed_arg
  25. {
  26. typedef Arg next;
  27. typedef T type;
  28. };
  29. template<
  30. typename Arg
  31. >
  32. struct replace_unnamed_arg< arg< -1 >, Arg >
  33. {
  34. typedef typename Arg::next next;
  35. typedef Arg type;
  36. };
  37. template<
  38. int N, typename U1, typename U2, typename U3, typename U4, typename U5
  39. >
  40. struct resolve_bind_arg< arg<N>, U1, U2, U3, U4, U5 >
  41. {
  42. typedef typename apply_wrap5<mpl::arg<N>, U1, U2, U3, U4, U5>::type type;
  43. };
  44. } // namespace aux
  45. template<
  46. typename F
  47. >
  48. struct bind0
  49. {
  50. template<
  51. typename U1, typename U2, typename U3, typename U4, typename U5
  52. >
  53. struct apply
  54. {
  55. private:
  56. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  57. typedef typename r0::type a0;
  58. typedef typename r0::next n1;
  59. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  60. ///
  61. public:
  62. typedef typename apply_wrap0<
  63. f_
  64. >::type type;
  65. };
  66. };
  67. namespace aux {
  68. template<
  69. typename F, typename U1, typename U2, typename U3, typename U4
  70. , typename U5
  71. >
  72. struct resolve_bind_arg<
  73. bind0<F>, U1, U2, U3, U4, U5
  74. >
  75. {
  76. typedef bind0<F> f_;
  77. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  78. };
  79. } // namespace aux
  80. BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
  81. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
  82. template<
  83. typename F, typename T1
  84. >
  85. struct bind1
  86. {
  87. template<
  88. typename U1, typename U2, typename U3, typename U4, typename U5
  89. >
  90. struct apply
  91. {
  92. private:
  93. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  94. typedef typename r0::type a0;
  95. typedef typename r0::next n1;
  96. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  97. ///
  98. typedef aux::replace_unnamed_arg< T1,n1 > r1;
  99. typedef typename r1::type a1;
  100. typedef typename r1::next n2;
  101. typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
  102. ///
  103. public:
  104. typedef typename apply_wrap1<
  105. f_
  106. , typename t1::type
  107. >::type type;
  108. };
  109. };
  110. namespace aux {
  111. template<
  112. typename F, typename T1, typename U1, typename U2, typename U3
  113. , typename U4, typename U5
  114. >
  115. struct resolve_bind_arg<
  116. bind1< F,T1 >, U1, U2, U3, U4, U5
  117. >
  118. {
  119. typedef bind1< F,T1 > f_;
  120. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  121. };
  122. } // namespace aux
  123. BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
  124. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
  125. template<
  126. typename F, typename T1, typename T2
  127. >
  128. struct bind2
  129. {
  130. template<
  131. typename U1, typename U2, typename U3, typename U4, typename U5
  132. >
  133. struct apply
  134. {
  135. private:
  136. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  137. typedef typename r0::type a0;
  138. typedef typename r0::next n1;
  139. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  140. ///
  141. typedef aux::replace_unnamed_arg< T1,n1 > r1;
  142. typedef typename r1::type a1;
  143. typedef typename r1::next n2;
  144. typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
  145. ///
  146. typedef aux::replace_unnamed_arg< T2,n2 > r2;
  147. typedef typename r2::type a2;
  148. typedef typename r2::next n3;
  149. typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
  150. ///
  151. public:
  152. typedef typename apply_wrap2<
  153. f_
  154. , typename t1::type, typename t2::type
  155. >::type type;
  156. };
  157. };
  158. namespace aux {
  159. template<
  160. typename F, typename T1, typename T2, typename U1, typename U2
  161. , typename U3, typename U4, typename U5
  162. >
  163. struct resolve_bind_arg<
  164. bind2< F,T1,T2 >, U1, U2, U3, U4, U5
  165. >
  166. {
  167. typedef bind2< F,T1,T2 > f_;
  168. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  169. };
  170. } // namespace aux
  171. BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
  172. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
  173. template<
  174. typename F, typename T1, typename T2, typename T3
  175. >
  176. struct bind3
  177. {
  178. template<
  179. typename U1, typename U2, typename U3, typename U4, typename U5
  180. >
  181. struct apply
  182. {
  183. private:
  184. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  185. typedef typename r0::type a0;
  186. typedef typename r0::next n1;
  187. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  188. ///
  189. typedef aux::replace_unnamed_arg< T1,n1 > r1;
  190. typedef typename r1::type a1;
  191. typedef typename r1::next n2;
  192. typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
  193. ///
  194. typedef aux::replace_unnamed_arg< T2,n2 > r2;
  195. typedef typename r2::type a2;
  196. typedef typename r2::next n3;
  197. typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
  198. ///
  199. typedef aux::replace_unnamed_arg< T3,n3 > r3;
  200. typedef typename r3::type a3;
  201. typedef typename r3::next n4;
  202. typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
  203. ///
  204. public:
  205. typedef typename apply_wrap3<
  206. f_
  207. , typename t1::type, typename t2::type, typename t3::type
  208. >::type type;
  209. };
  210. };
  211. namespace aux {
  212. template<
  213. typename F, typename T1, typename T2, typename T3, typename U1
  214. , typename U2, typename U3, typename U4, typename U5
  215. >
  216. struct resolve_bind_arg<
  217. bind3< F,T1,T2,T3 >, U1, U2, U3, U4, U5
  218. >
  219. {
  220. typedef bind3< F,T1,T2,T3 > f_;
  221. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  222. };
  223. } // namespace aux
  224. BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
  225. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
  226. template<
  227. typename F, typename T1, typename T2, typename T3, typename T4
  228. >
  229. struct bind4
  230. {
  231. template<
  232. typename U1, typename U2, typename U3, typename U4, typename U5
  233. >
  234. struct apply
  235. {
  236. private:
  237. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  238. typedef typename r0::type a0;
  239. typedef typename r0::next n1;
  240. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  241. ///
  242. typedef aux::replace_unnamed_arg< T1,n1 > r1;
  243. typedef typename r1::type a1;
  244. typedef typename r1::next n2;
  245. typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
  246. ///
  247. typedef aux::replace_unnamed_arg< T2,n2 > r2;
  248. typedef typename r2::type a2;
  249. typedef typename r2::next n3;
  250. typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
  251. ///
  252. typedef aux::replace_unnamed_arg< T3,n3 > r3;
  253. typedef typename r3::type a3;
  254. typedef typename r3::next n4;
  255. typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
  256. ///
  257. typedef aux::replace_unnamed_arg< T4,n4 > r4;
  258. typedef typename r4::type a4;
  259. typedef typename r4::next n5;
  260. typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
  261. ///
  262. public:
  263. typedef typename apply_wrap4<
  264. f_
  265. , typename t1::type, typename t2::type, typename t3::type
  266. , typename t4::type
  267. >::type type;
  268. };
  269. };
  270. namespace aux {
  271. template<
  272. typename F, typename T1, typename T2, typename T3, typename T4
  273. , typename U1, typename U2, typename U3, typename U4, typename U5
  274. >
  275. struct resolve_bind_arg<
  276. bind4< F,T1,T2,T3,T4 >, U1, U2, U3, U4, U5
  277. >
  278. {
  279. typedef bind4< F,T1,T2,T3,T4 > f_;
  280. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  281. };
  282. } // namespace aux
  283. BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
  284. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
  285. template<
  286. typename F, typename T1, typename T2, typename T3, typename T4
  287. , typename T5
  288. >
  289. struct bind5
  290. {
  291. template<
  292. typename U1, typename U2, typename U3, typename U4, typename U5
  293. >
  294. struct apply
  295. {
  296. private:
  297. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  298. typedef typename r0::type a0;
  299. typedef typename r0::next n1;
  300. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  301. ///
  302. typedef aux::replace_unnamed_arg< T1,n1 > r1;
  303. typedef typename r1::type a1;
  304. typedef typename r1::next n2;
  305. typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
  306. ///
  307. typedef aux::replace_unnamed_arg< T2,n2 > r2;
  308. typedef typename r2::type a2;
  309. typedef typename r2::next n3;
  310. typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
  311. ///
  312. typedef aux::replace_unnamed_arg< T3,n3 > r3;
  313. typedef typename r3::type a3;
  314. typedef typename r3::next n4;
  315. typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
  316. ///
  317. typedef aux::replace_unnamed_arg< T4,n4 > r4;
  318. typedef typename r4::type a4;
  319. typedef typename r4::next n5;
  320. typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
  321. ///
  322. typedef aux::replace_unnamed_arg< T5,n5 > r5;
  323. typedef typename r5::type a5;
  324. typedef typename r5::next n6;
  325. typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5;
  326. ///
  327. public:
  328. typedef typename apply_wrap5<
  329. f_
  330. , typename t1::type, typename t2::type, typename t3::type
  331. , typename t4::type, typename t5::type
  332. >::type type;
  333. };
  334. };
  335. namespace aux {
  336. template<
  337. typename F, typename T1, typename T2, typename T3, typename T4
  338. , typename T5, typename U1, typename U2, typename U3, typename U4
  339. , typename U5
  340. >
  341. struct resolve_bind_arg<
  342. bind5< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5
  343. >
  344. {
  345. typedef bind5< F,T1,T2,T3,T4,T5 > f_;
  346. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  347. };
  348. } // namespace aux
  349. BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
  350. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
  351. }}