basic_bind.hpp 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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< bool >
  13. struct resolve_arg_impl
  14. {
  15. template<
  16. typename T, typename U1, typename U2, typename U3
  17. , typename U4, typename U5
  18. >
  19. struct result_
  20. {
  21. typedef T type;
  22. };
  23. };
  24. template<>
  25. struct resolve_arg_impl<true>
  26. {
  27. template<
  28. typename T, typename U1, typename U2, typename U3
  29. , typename U4, typename U5
  30. >
  31. struct result_
  32. {
  33. typedef typename apply_wrap5<
  34. T
  35. , U1, U2, U3, U4, U5
  36. >::type type;
  37. };
  38. };
  39. template< typename T > struct is_bind_template;
  40. template<
  41. typename T, typename U1, typename U2, typename U3, typename U4
  42. , typename U5
  43. >
  44. struct resolve_bind_arg
  45. : resolve_arg_impl< is_bind_template<T>::value >
  46. ::template result_< T,U1,U2,U3,U4,U5 >
  47. {
  48. };
  49. template< int arity_ > struct bind_chooser;
  50. aux::no_tag is_bind_helper(...);
  51. template< typename T > aux::no_tag is_bind_helper(protect<T>*);
  52. template< int N >
  53. aux::yes_tag is_bind_helper(arg<N>*);
  54. template< bool is_ref_ = true >
  55. struct is_bind_template_impl
  56. {
  57. template< typename T > struct result_
  58. {
  59. BOOST_STATIC_CONSTANT(bool, value = false);
  60. };
  61. };
  62. template<>
  63. struct is_bind_template_impl<false>
  64. {
  65. template< typename T > struct result_
  66. {
  67. BOOST_STATIC_CONSTANT(bool, value =
  68. sizeof(aux::is_bind_helper(static_cast<T*>(0)))
  69. == sizeof(aux::yes_tag)
  70. );
  71. };
  72. };
  73. template< typename T > struct is_bind_template
  74. : is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
  75. ::template result_<T>
  76. {
  77. };
  78. } // namespace aux
  79. template<
  80. typename F
  81. >
  82. struct bind0
  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. public:
  93. typedef typename apply_wrap0<
  94. f_
  95. >::type type;
  96. };
  97. };
  98. namespace aux {
  99. template<
  100. typename F
  101. >
  102. aux::yes_tag
  103. is_bind_helper(bind0<F>*);
  104. } // namespace aux
  105. BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
  106. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
  107. template<
  108. typename F, typename T1
  109. >
  110. struct bind1
  111. {
  112. template<
  113. typename U1 = na, typename U2 = na, typename U3 = na
  114. , typename U4 = na, typename U5 = na
  115. >
  116. struct apply
  117. {
  118. private:
  119. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  120. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  121. public:
  122. typedef typename apply_wrap1<
  123. f_
  124. , typename t1::type
  125. >::type type;
  126. };
  127. };
  128. namespace aux {
  129. template<
  130. typename F, typename T1
  131. >
  132. aux::yes_tag
  133. is_bind_helper(bind1< F,T1 >*);
  134. } // namespace aux
  135. BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
  136. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
  137. template<
  138. typename F, typename T1, typename T2
  139. >
  140. struct bind2
  141. {
  142. template<
  143. typename U1 = na, typename U2 = na, typename U3 = na
  144. , typename U4 = na, typename U5 = na
  145. >
  146. struct apply
  147. {
  148. private:
  149. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  150. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  151. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  152. public:
  153. typedef typename apply_wrap2<
  154. f_
  155. , typename t1::type, typename t2::type
  156. >::type type;
  157. };
  158. };
  159. namespace aux {
  160. template<
  161. typename F, typename T1, typename T2
  162. >
  163. aux::yes_tag
  164. is_bind_helper(bind2< F,T1,T2 >*);
  165. } // namespace aux
  166. BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
  167. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
  168. template<
  169. typename F, typename T1, typename T2, typename T3
  170. >
  171. struct bind3
  172. {
  173. template<
  174. typename U1 = na, typename U2 = na, typename U3 = na
  175. , typename U4 = na, typename U5 = na
  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. public:
  185. typedef typename apply_wrap3<
  186. f_
  187. , typename t1::type, typename t2::type, typename t3::type
  188. >::type type;
  189. };
  190. };
  191. namespace aux {
  192. template<
  193. typename F, typename T1, typename T2, typename T3
  194. >
  195. aux::yes_tag
  196. is_bind_helper(bind3< F,T1,T2,T3 >*);
  197. } // namespace aux
  198. BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
  199. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
  200. template<
  201. typename F, typename T1, typename T2, typename T3, typename T4
  202. >
  203. struct bind4
  204. {
  205. template<
  206. typename U1 = na, typename U2 = na, typename U3 = na
  207. , typename U4 = na, typename U5 = na
  208. >
  209. struct apply
  210. {
  211. private:
  212. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  213. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  214. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  215. typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
  216. typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
  217. public:
  218. typedef typename apply_wrap4<
  219. f_
  220. , typename t1::type, typename t2::type, typename t3::type
  221. , typename t4::type
  222. >::type type;
  223. };
  224. };
  225. namespace aux {
  226. template<
  227. typename F, typename T1, typename T2, typename T3, typename T4
  228. >
  229. aux::yes_tag
  230. is_bind_helper(bind4< F,T1,T2,T3,T4 >*);
  231. } // namespace aux
  232. BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
  233. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
  234. template<
  235. typename F, typename T1, typename T2, typename T3, typename T4
  236. , typename T5
  237. >
  238. struct bind5
  239. {
  240. template<
  241. typename U1 = na, typename U2 = na, typename U3 = na
  242. , typename U4 = na, typename U5 = na
  243. >
  244. struct apply
  245. {
  246. private:
  247. typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
  248. typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
  249. typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
  250. typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
  251. typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
  252. typedef aux::resolve_bind_arg< T5,U1,U2,U3,U4,U5 > t5;
  253. public:
  254. typedef typename apply_wrap5<
  255. f_
  256. , typename t1::type, typename t2::type, typename t3::type
  257. , typename t4::type, typename t5::type
  258. >::type type;
  259. };
  260. };
  261. namespace aux {
  262. template<
  263. typename F, typename T1, typename T2, typename T3, typename T4
  264. , typename T5
  265. >
  266. aux::yes_tag
  267. is_bind_helper(bind5< F,T1,T2,T3,T4,T5 >*);
  268. } // namespace aux
  269. BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
  270. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
  271. }}