basic_bind.hpp 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  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 "boost/mpl/aux_/basic_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. int N, typename U1, typename U2, typename U3, typename U4, typename U5
  22. >
  23. struct resolve_bind_arg< arg<N>, U1, U2, U3, U4, U5 >
  24. {
  25. typedef typename apply_wrap5<mpl::arg<N>, U1, U2, U3, U4, U5>::type type;
  26. };
  27. template<
  28. typename F, typename T1, typename T2, typename T3, typename T4
  29. , typename T5, typename U1, typename U2, typename U3, typename U4
  30. , typename U5
  31. >
  32. struct resolve_bind_arg< bind< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5 >
  33. {
  34. typedef bind< F,T1,T2,T3,T4,T5 > f_;
  35. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  36. };
  37. } // namespace aux
  38. template<
  39. typename F, int dummy_
  40. >
  41. struct bind0
  42. {
  43. template<
  44. typename U1 = na, typename U2 = na, typename U3 = na
  45. , typename U4 = na, typename U5 = na
  46. >
  47. struct apply
  48. {
  49. private:
  50. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  51. public:
  52. typedef typename apply_wrap0<
  53. f_
  54. >::type type;
  55. };
  56. };
  57. namespace aux {
  58. template<
  59. typename F, typename U1, typename U2, typename U3, typename U4
  60. , typename U5
  61. >
  62. struct resolve_bind_arg<
  63. bind0<F>, U1, U2, U3, U4, U5
  64. >
  65. {
  66. typedef bind0<F> f_;
  67. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  68. };
  69. } // namespace aux
  70. BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
  71. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
  72. template<
  73. typename F, int dummy_
  74. >
  75. struct bind< F,na,na,na,na,na >
  76. : bind0<F>
  77. {
  78. };
  79. template<
  80. typename F, typename T1, int dummy_
  81. >
  82. struct bind1
  83. {
  84. template<
  85. typename U1 = na, typename U2 = na, typename U3 = na
  86. , typename U4 = na, typename U5 = na
  87. >
  88. struct apply
  89. {
  90. private:
  91. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  92. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  93. public:
  94. typedef typename apply_wrap1<
  95. f_
  96. , typename t1::type
  97. >::type type;
  98. };
  99. };
  100. namespace aux {
  101. template<
  102. typename F, typename T1, typename U1, typename U2, typename U3
  103. , typename U4, typename U5
  104. >
  105. struct resolve_bind_arg<
  106. bind1< F,T1 >, U1, U2, U3, U4, U5
  107. >
  108. {
  109. typedef bind1< F,T1 > f_;
  110. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  111. };
  112. } // namespace aux
  113. BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
  114. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
  115. template<
  116. typename F, typename T1, int dummy_
  117. >
  118. struct bind< F,T1,na,na,na,na >
  119. : bind1< F,T1 >
  120. {
  121. };
  122. template<
  123. typename F, typename T1, typename T2, int dummy_
  124. >
  125. struct bind2
  126. {
  127. template<
  128. typename U1 = na, typename U2 = na, typename U3 = na
  129. , typename U4 = na, typename U5 = na
  130. >
  131. struct apply
  132. {
  133. private:
  134. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  135. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  136. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  137. public:
  138. typedef typename apply_wrap2<
  139. f_
  140. , typename t1::type, typename t2::type
  141. >::type type;
  142. };
  143. };
  144. namespace aux {
  145. template<
  146. typename F, typename T1, typename T2, typename U1, typename U2
  147. , typename U3, typename U4, typename U5
  148. >
  149. struct resolve_bind_arg<
  150. bind2< F,T1,T2 >, U1, U2, U3, U4, U5
  151. >
  152. {
  153. typedef bind2< F,T1,T2 > f_;
  154. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  155. };
  156. } // namespace aux
  157. BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
  158. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
  159. template<
  160. typename F, typename T1, typename T2, int dummy_
  161. >
  162. struct bind< F,T1,T2,na,na,na >
  163. : bind2< F,T1,T2 >
  164. {
  165. };
  166. template<
  167. typename F, typename T1, typename T2, typename T3, int dummy_
  168. >
  169. struct bind3
  170. {
  171. template<
  172. typename U1 = na, typename U2 = na, typename U3 = na
  173. , typename U4 = na, typename U5 = na
  174. >
  175. struct apply
  176. {
  177. private:
  178. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  179. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  180. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  181. typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
  182. public:
  183. typedef typename apply_wrap3<
  184. f_
  185. , typename t1::type, typename t2::type, typename t3::type
  186. >::type type;
  187. };
  188. };
  189. namespace aux {
  190. template<
  191. typename F, typename T1, typename T2, typename T3, typename U1
  192. , typename U2, typename U3, typename U4, typename U5
  193. >
  194. struct resolve_bind_arg<
  195. bind3< F,T1,T2,T3 >, U1, U2, U3, U4, U5
  196. >
  197. {
  198. typedef bind3< F,T1,T2,T3 > f_;
  199. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  200. };
  201. } // namespace aux
  202. BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
  203. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
  204. template<
  205. typename F, typename T1, typename T2, typename T3, int dummy_
  206. >
  207. struct bind< F,T1,T2,T3,na,na >
  208. : bind3< F,T1,T2,T3 >
  209. {
  210. };
  211. template<
  212. typename F, typename T1, typename T2, typename T3, typename T4
  213. , int dummy_
  214. >
  215. struct bind4
  216. {
  217. template<
  218. typename U1 = na, typename U2 = na, typename U3 = na
  219. , typename U4 = na, typename U5 = na
  220. >
  221. struct apply
  222. {
  223. private:
  224. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  225. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  226. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  227. typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
  228. typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
  229. public:
  230. typedef typename apply_wrap4<
  231. f_
  232. , typename t1::type, typename t2::type, typename t3::type
  233. , typename t4::type
  234. >::type type;
  235. };
  236. };
  237. namespace aux {
  238. template<
  239. typename F, typename T1, typename T2, typename T3, typename T4
  240. , typename U1, typename U2, typename U3, typename U4, typename U5
  241. >
  242. struct resolve_bind_arg<
  243. bind4< F,T1,T2,T3,T4 >, U1, U2, U3, U4, U5
  244. >
  245. {
  246. typedef bind4< F,T1,T2,T3,T4 > f_;
  247. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  248. };
  249. } // namespace aux
  250. BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
  251. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
  252. template<
  253. typename F, typename T1, typename T2, typename T3, typename T4
  254. , int dummy_
  255. >
  256. struct bind< F,T1,T2,T3,T4,na >
  257. : bind4< F,T1,T2,T3,T4 >
  258. {
  259. };
  260. template<
  261. typename F, typename T1, typename T2, typename T3, typename T4
  262. , typename T5, int dummy_
  263. >
  264. struct bind5
  265. {
  266. template<
  267. typename U1 = na, typename U2 = na, typename U3 = na
  268. , typename U4 = na, typename U5 = na
  269. >
  270. struct apply
  271. {
  272. private:
  273. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  274. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  275. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  276. typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
  277. typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
  278. typedef aux::resolve_bind_arg< T5,U1,U2,U3,U4,U5 > t5;
  279. public:
  280. typedef typename apply_wrap5<
  281. f_
  282. , typename t1::type, typename t2::type, typename t3::type
  283. , typename t4::type, typename t5::type
  284. >::type type;
  285. };
  286. };
  287. namespace aux {
  288. template<
  289. typename F, typename T1, typename T2, typename T3, typename T4
  290. , typename T5, typename U1, typename U2, typename U3, typename U4
  291. , typename U5
  292. >
  293. struct resolve_bind_arg<
  294. bind5< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5
  295. >
  296. {
  297. typedef bind5< F,T1,T2,T3,T4,T5 > f_;
  298. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  299. };
  300. } // namespace aux
  301. BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
  302. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
  303. /// primary template (not a specialization!)
  304. template<
  305. typename F, typename T1, typename T2, typename T3, typename T4
  306. , typename T5, int dummy_
  307. >
  308. struct bind
  309. : bind5< F,T1,T2,T3,T4,T5 >
  310. {
  311. };
  312. /// if_/eval_if specializations
  313. template< template< typename T1, typename T2, typename T3 > class F, typename Tag >
  314. struct quote3;
  315. template< typename T1, typename T2, typename T3 > struct if_;
  316. template<
  317. typename Tag, typename T1, typename T2, typename T3
  318. >
  319. struct bind3<
  320. quote3< if_,Tag >
  321. , T1, T2, T3
  322. >
  323. {
  324. template<
  325. typename U1 = na, typename U2 = na, typename U3 = na
  326. , typename U4 = na, typename U5 = na
  327. >
  328. struct apply
  329. {
  330. private:
  331. typedef mpl::arg<1> n1;
  332. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  333. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  334. typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
  335. typedef typename if_<
  336. typename t1::type
  337. , t2, t3
  338. >::type f_;
  339. public:
  340. typedef typename f_::type type;
  341. };
  342. };
  343. }}