bind.hpp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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/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< typename T >
  50. struct replace_unnamed_arg_impl
  51. {
  52. template< typename Arg > struct result_
  53. {
  54. typedef Arg next;
  55. typedef T type;
  56. };
  57. };
  58. template<>
  59. struct replace_unnamed_arg_impl< arg< -1 > >
  60. {
  61. template< typename Arg > struct result_
  62. {
  63. typedef typename next<Arg>::type next;
  64. typedef Arg type;
  65. };
  66. };
  67. template< typename T, typename Arg >
  68. struct replace_unnamed_arg
  69. : replace_unnamed_arg_impl<T>::template result_<Arg>
  70. {
  71. };
  72. template< int arity_ > struct bind_chooser;
  73. aux::no_tag is_bind_helper(...);
  74. template< typename T > aux::no_tag is_bind_helper(protect<T>*);
  75. template< int N >
  76. aux::yes_tag is_bind_helper(arg<N>*);
  77. template< bool is_ref_ = true >
  78. struct is_bind_template_impl
  79. {
  80. template< typename T > struct result_
  81. {
  82. BOOST_STATIC_CONSTANT(bool, value = false);
  83. };
  84. };
  85. template<>
  86. struct is_bind_template_impl<false>
  87. {
  88. template< typename T > struct result_
  89. {
  90. BOOST_STATIC_CONSTANT(bool, value =
  91. sizeof(aux::is_bind_helper(static_cast<T*>(0)))
  92. == sizeof(aux::yes_tag)
  93. );
  94. };
  95. };
  96. template< typename T > struct is_bind_template
  97. : is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
  98. ::template result_<T>
  99. {
  100. };
  101. } // namespace aux
  102. template<
  103. typename F
  104. >
  105. struct bind0
  106. {
  107. template<
  108. typename U1 = na, typename U2 = na, typename U3 = na
  109. , typename U4 = na, typename U5 = na
  110. >
  111. struct apply
  112. {
  113. private:
  114. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  115. typedef typename r0::type a0;
  116. typedef typename r0::next n1;
  117. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  118. ///
  119. public:
  120. typedef typename apply_wrap0<
  121. f_
  122. >::type type;
  123. };
  124. };
  125. namespace aux {
  126. template<
  127. typename F
  128. >
  129. aux::yes_tag
  130. is_bind_helper(bind0<F>*);
  131. } // namespace aux
  132. BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
  133. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
  134. template<
  135. typename F, typename T1
  136. >
  137. struct bind1
  138. {
  139. template<
  140. typename U1 = na, typename U2 = na, typename U3 = na
  141. , typename U4 = na, typename U5 = na
  142. >
  143. struct apply
  144. {
  145. private:
  146. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  147. typedef typename r0::type a0;
  148. typedef typename r0::next n1;
  149. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  150. ///
  151. typedef aux::replace_unnamed_arg< T1,n1 > r1;
  152. typedef typename r1::type a1;
  153. typedef typename r1::next n2;
  154. typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
  155. ///
  156. public:
  157. typedef typename apply_wrap1<
  158. f_
  159. , typename t1::type
  160. >::type type;
  161. };
  162. };
  163. namespace aux {
  164. template<
  165. typename F, typename T1
  166. >
  167. aux::yes_tag
  168. is_bind_helper(bind1< F,T1 >*);
  169. } // namespace aux
  170. BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
  171. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
  172. template<
  173. typename F, typename T1, typename T2
  174. >
  175. struct bind2
  176. {
  177. template<
  178. typename U1 = na, typename U2 = na, typename U3 = na
  179. , typename U4 = na, typename U5 = na
  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. public:
  200. typedef typename apply_wrap2<
  201. f_
  202. , typename t1::type, typename t2::type
  203. >::type type;
  204. };
  205. };
  206. namespace aux {
  207. template<
  208. typename F, typename T1, typename T2
  209. >
  210. aux::yes_tag
  211. is_bind_helper(bind2< F,T1,T2 >*);
  212. } // namespace aux
  213. BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
  214. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
  215. template<
  216. typename F, typename T1, typename T2, typename T3
  217. >
  218. struct bind3
  219. {
  220. template<
  221. typename U1 = na, typename U2 = na, typename U3 = na
  222. , typename U4 = na, typename U5 = na
  223. >
  224. struct apply
  225. {
  226. private:
  227. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  228. typedef typename r0::type a0;
  229. typedef typename r0::next n1;
  230. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  231. ///
  232. typedef aux::replace_unnamed_arg< T1,n1 > r1;
  233. typedef typename r1::type a1;
  234. typedef typename r1::next n2;
  235. typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
  236. ///
  237. typedef aux::replace_unnamed_arg< T2,n2 > r2;
  238. typedef typename r2::type a2;
  239. typedef typename r2::next n3;
  240. typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
  241. ///
  242. typedef aux::replace_unnamed_arg< T3,n3 > r3;
  243. typedef typename r3::type a3;
  244. typedef typename r3::next n4;
  245. typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
  246. ///
  247. public:
  248. typedef typename apply_wrap3<
  249. f_
  250. , typename t1::type, typename t2::type, typename t3::type
  251. >::type type;
  252. };
  253. };
  254. namespace aux {
  255. template<
  256. typename F, typename T1, typename T2, typename T3
  257. >
  258. aux::yes_tag
  259. is_bind_helper(bind3< F,T1,T2,T3 >*);
  260. } // namespace aux
  261. BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
  262. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
  263. template<
  264. typename F, typename T1, typename T2, typename T3, typename T4
  265. >
  266. struct bind4
  267. {
  268. template<
  269. typename U1 = na, typename U2 = na, typename U3 = na
  270. , typename U4 = na, typename U5 = na
  271. >
  272. struct apply
  273. {
  274. private:
  275. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  276. typedef typename r0::type a0;
  277. typedef typename r0::next n1;
  278. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  279. ///
  280. typedef aux::replace_unnamed_arg< T1,n1 > r1;
  281. typedef typename r1::type a1;
  282. typedef typename r1::next n2;
  283. typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
  284. ///
  285. typedef aux::replace_unnamed_arg< T2,n2 > r2;
  286. typedef typename r2::type a2;
  287. typedef typename r2::next n3;
  288. typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
  289. ///
  290. typedef aux::replace_unnamed_arg< T3,n3 > r3;
  291. typedef typename r3::type a3;
  292. typedef typename r3::next n4;
  293. typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
  294. ///
  295. typedef aux::replace_unnamed_arg< T4,n4 > r4;
  296. typedef typename r4::type a4;
  297. typedef typename r4::next n5;
  298. typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
  299. ///
  300. public:
  301. typedef typename apply_wrap4<
  302. f_
  303. , typename t1::type, typename t2::type, typename t3::type
  304. , typename t4::type
  305. >::type type;
  306. };
  307. };
  308. namespace aux {
  309. template<
  310. typename F, typename T1, typename T2, typename T3, typename T4
  311. >
  312. aux::yes_tag
  313. is_bind_helper(bind4< F,T1,T2,T3,T4 >*);
  314. } // namespace aux
  315. BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
  316. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
  317. template<
  318. typename F, typename T1, typename T2, typename T3, typename T4
  319. , typename T5
  320. >
  321. struct bind5
  322. {
  323. template<
  324. typename U1 = na, typename U2 = na, typename U3 = na
  325. , typename U4 = na, typename U5 = na
  326. >
  327. struct apply
  328. {
  329. private:
  330. typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
  331. typedef typename r0::type a0;
  332. typedef typename r0::next n1;
  333. typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
  334. ///
  335. typedef aux::replace_unnamed_arg< T1,n1 > r1;
  336. typedef typename r1::type a1;
  337. typedef typename r1::next n2;
  338. typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
  339. ///
  340. typedef aux::replace_unnamed_arg< T2,n2 > r2;
  341. typedef typename r2::type a2;
  342. typedef typename r2::next n3;
  343. typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
  344. ///
  345. typedef aux::replace_unnamed_arg< T3,n3 > r3;
  346. typedef typename r3::type a3;
  347. typedef typename r3::next n4;
  348. typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
  349. ///
  350. typedef aux::replace_unnamed_arg< T4,n4 > r4;
  351. typedef typename r4::type a4;
  352. typedef typename r4::next n5;
  353. typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
  354. ///
  355. typedef aux::replace_unnamed_arg< T5,n5 > r5;
  356. typedef typename r5::type a5;
  357. typedef typename r5::next n6;
  358. typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5;
  359. ///
  360. public:
  361. typedef typename apply_wrap5<
  362. f_
  363. , typename t1::type, typename t2::type, typename t3::type
  364. , typename t4::type, typename t5::type
  365. >::type type;
  366. };
  367. };
  368. namespace aux {
  369. template<
  370. typename F, typename T1, typename T2, typename T3, typename T4
  371. , typename T5
  372. >
  373. aux::yes_tag
  374. is_bind_helper(bind5< F,T1,T2,T3,T4,T5 >*);
  375. } // namespace aux
  376. BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
  377. BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
  378. }}