basic_bind.hpp 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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 "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. } // namespace aux
  28. template<
  29. typename F
  30. >
  31. struct bind0
  32. {
  33. template<
  34. typename U1, typename U2, typename U3, typename U4, typename U5
  35. >
  36. struct apply
  37. {
  38. private:
  39. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  40. public:
  41. typedef typename apply_wrap0<
  42. f_
  43. >::type type;
  44. };
  45. };
  46. namespace aux {
  47. template<
  48. typename F, typename U1, typename U2, typename U3, typename U4
  49. , typename U5
  50. >
  51. struct resolve_bind_arg<
  52. bind0<F>, U1, U2, U3, U4, U5
  53. >
  54. {
  55. typedef bind0<F> f_;
  56. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  57. };
  58. } // namespace aux
  59. BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
  60. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
  61. template<
  62. typename F, typename T1
  63. >
  64. struct bind1
  65. {
  66. template<
  67. typename U1, typename U2, typename U3, typename U4, typename U5
  68. >
  69. struct apply
  70. {
  71. private:
  72. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  73. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  74. public:
  75. typedef typename apply_wrap1<
  76. f_
  77. , typename t1::type
  78. >::type type;
  79. };
  80. };
  81. namespace aux {
  82. template<
  83. typename F, typename T1, typename U1, typename U2, typename U3
  84. , typename U4, typename U5
  85. >
  86. struct resolve_bind_arg<
  87. bind1< F,T1 >, U1, U2, U3, U4, U5
  88. >
  89. {
  90. typedef bind1< F,T1 > f_;
  91. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  92. };
  93. } // namespace aux
  94. BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
  95. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
  96. template<
  97. typename F, typename T1, typename T2
  98. >
  99. struct bind2
  100. {
  101. template<
  102. typename U1, typename U2, typename U3, typename U4, typename U5
  103. >
  104. struct apply
  105. {
  106. private:
  107. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  108. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  109. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  110. public:
  111. typedef typename apply_wrap2<
  112. f_
  113. , typename t1::type, typename t2::type
  114. >::type type;
  115. };
  116. };
  117. namespace aux {
  118. template<
  119. typename F, typename T1, typename T2, typename U1, typename U2
  120. , typename U3, typename U4, typename U5
  121. >
  122. struct resolve_bind_arg<
  123. bind2< F,T1,T2 >, U1, U2, U3, U4, U5
  124. >
  125. {
  126. typedef bind2< F,T1,T2 > f_;
  127. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  128. };
  129. } // namespace aux
  130. BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
  131. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
  132. template<
  133. typename F, typename T1, typename T2, typename T3
  134. >
  135. struct bind3
  136. {
  137. template<
  138. typename U1, typename U2, typename U3, typename U4, typename U5
  139. >
  140. struct apply
  141. {
  142. private:
  143. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  144. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  145. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  146. typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
  147. public:
  148. typedef typename apply_wrap3<
  149. f_
  150. , typename t1::type, typename t2::type, typename t3::type
  151. >::type type;
  152. };
  153. };
  154. namespace aux {
  155. template<
  156. typename F, typename T1, typename T2, typename T3, typename U1
  157. , typename U2, typename U3, typename U4, typename U5
  158. >
  159. struct resolve_bind_arg<
  160. bind3< F,T1,T2,T3 >, U1, U2, U3, U4, U5
  161. >
  162. {
  163. typedef bind3< F,T1,T2,T3 > f_;
  164. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  165. };
  166. } // namespace aux
  167. BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
  168. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
  169. template<
  170. typename F, typename T1, typename T2, typename T3, typename T4
  171. >
  172. struct bind4
  173. {
  174. template<
  175. typename U1, typename U2, typename U3, typename U4, typename U5
  176. >
  177. struct apply
  178. {
  179. private:
  180. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  181. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  182. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  183. typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
  184. typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
  185. public:
  186. typedef typename apply_wrap4<
  187. f_
  188. , typename t1::type, typename t2::type, typename t3::type
  189. , typename t4::type
  190. >::type type;
  191. };
  192. };
  193. namespace aux {
  194. template<
  195. typename F, typename T1, typename T2, typename T3, typename T4
  196. , typename U1, typename U2, typename U3, typename U4, typename U5
  197. >
  198. struct resolve_bind_arg<
  199. bind4< F,T1,T2,T3,T4 >, U1, U2, U3, U4, U5
  200. >
  201. {
  202. typedef bind4< F,T1,T2,T3,T4 > f_;
  203. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  204. };
  205. } // namespace aux
  206. BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
  207. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
  208. template<
  209. typename F, typename T1, typename T2, typename T3, typename T4
  210. , typename T5
  211. >
  212. struct bind5
  213. {
  214. template<
  215. typename U1, typename U2, typename U3, typename U4, typename U5
  216. >
  217. struct apply
  218. {
  219. private:
  220. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  221. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  222. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  223. typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
  224. typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
  225. typedef aux::resolve_bind_arg< T5,U1,U2,U3,U4,U5 > t5;
  226. public:
  227. typedef typename apply_wrap5<
  228. f_
  229. , typename t1::type, typename t2::type, typename t3::type
  230. , typename t4::type, typename t5::type
  231. >::type type;
  232. };
  233. };
  234. namespace aux {
  235. template<
  236. typename F, typename T1, typename T2, typename T3, typename T4
  237. , typename T5, typename U1, typename U2, typename U3, typename U4
  238. , typename U5
  239. >
  240. struct resolve_bind_arg<
  241. bind5< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5
  242. >
  243. {
  244. typedef bind5< F,T1,T2,T3,T4,T5 > f_;
  245. typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
  246. };
  247. } // namespace aux
  248. BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
  249. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
  250. }}