PageRenderTime 37ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/src/core/environ/win32/bcb2006/include/boost/bind.hpp

http://tvpcn.codeplex.com
C++ Header | 1538 lines | 1144 code | 362 blank | 32 comment | 5 complexity | def9c1d87bd14ad23e6f686c9836a4c0 MD5 | raw file
Possible License(s): LGPL-3.0, MIT, LGPL-2.0
  1. #ifndef BOOST_BIND_HPP_INCLUDED
  2. #define BOOST_BIND_HPP_INCLUDED
  3. #if _MSC_VER >= 1020
  4. #pragma once
  5. #endif
  6. //
  7. // bind.hpp - binds function objects to arguments
  8. //
  9. // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
  10. // Copyright (c) 2001 David Abrahams
  11. //
  12. // Permission to copy, use, modify, sell and distribute this software
  13. // is granted provided this copyright notice appears in all copies.
  14. // This software is provided "as is" without express or implied
  15. // warranty, and with no claim as to its suitability for any purpose.
  16. //
  17. // See http://www.boost.org/libs/bind/bind.html for documentation.
  18. //
  19. #include <boost/config.hpp>
  20. #include <boost/ref.hpp>
  21. #include <boost/mem_fn.hpp>
  22. #include <boost/type.hpp>
  23. #include <boost/bind/arg.hpp>
  24. // Borland-specific bug, visit_each() silently fails to produce code
  25. #if defined(__BORLANDC__)
  26. # define BOOST_BIND_VISIT_EACH boost::visit_each
  27. #else
  28. # define BOOST_BIND_VISIT_EACH visit_each
  29. #endif
  30. #ifdef BOOST_MSVC
  31. # pragma warning(push)
  32. # pragma warning(disable: 4512) // assignment operator could not be generated
  33. #endif
  34. namespace boost
  35. {
  36. namespace _bi // implementation details
  37. {
  38. // result_traits
  39. template<class R, class F> struct result_traits
  40. {
  41. typedef R type;
  42. };
  43. #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
  44. struct unspecified {};
  45. template<class F> struct result_traits<unspecified, F>
  46. {
  47. typedef typename F::result_type type;
  48. };
  49. template<class F> struct result_traits< unspecified, reference_wrapper<F> >
  50. {
  51. typedef typename F::result_type type;
  52. };
  53. #endif
  54. // bind_t forward declaration for listN
  55. template<class R, class F, class L> class bind_t;
  56. // value
  57. template<class T> class value
  58. {
  59. public:
  60. value(T const & t): t_(t) {}
  61. T & get() { return t_; }
  62. T const & get() const { return t_; }
  63. private:
  64. T t_;
  65. };
  66. // type
  67. template<class T> class type {};
  68. // unwrap
  69. template<class F> inline F & unwrap(F & f, long)
  70. {
  71. return f;
  72. }
  73. template<class F> inline F & unwrap(reference_wrapper<F> & f, int)
  74. {
  75. return f;
  76. }
  77. template<class F> inline F & unwrap(reference_wrapper<F> const & f, int)
  78. {
  79. return f;
  80. }
  81. // listN
  82. #ifdef BOOST_NO_VOID_RETURNS
  83. template <class R> struct evaluator0;
  84. template <class R> struct evaluator1;
  85. template <class R> struct evaluator2;
  86. template <class R> struct evaluator3;
  87. template <class R> struct evaluator4;
  88. template <class R> struct evaluator5;
  89. template <class R> struct evaluator6;
  90. template <class R> struct evaluator7;
  91. template <class R> struct evaluator8;
  92. template <class R> struct evaluator9;
  93. #endif
  94. class list0
  95. {
  96. public:
  97. list0() {}
  98. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  99. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  100. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  101. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  102. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  103. template<class R, class F, class A> R operator()(type<R>, F f, A &) const
  104. {
  105. return unwrap(f, 0)();
  106. }
  107. template<class V> void accept(V &) const
  108. {
  109. }
  110. #ifdef BOOST_NO_VOID_RETURNS
  111. template<class R> struct evaluator
  112. {
  113. typedef evaluator0<R> type;
  114. };
  115. #endif
  116. };
  117. template<class A1> class list1
  118. {
  119. public:
  120. explicit list1(A1 a1): a1_(a1) {}
  121. A1 operator[] (boost::arg<1>) const { return a1_; }
  122. A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
  123. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  124. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  125. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  126. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  127. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  128. template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
  129. {
  130. return unwrap(f, 0)(a[a1_]);
  131. }
  132. template<class V> void accept(V & v) const
  133. {
  134. BOOST_BIND_VISIT_EACH(v, a1_, 0);
  135. }
  136. #ifdef BOOST_NO_VOID_RETURNS
  137. template<class R> struct evaluator
  138. {
  139. typedef evaluator1<R> type;
  140. };
  141. #else
  142. private:
  143. #endif
  144. A1 a1_;
  145. };
  146. template<class A1, class A2> class list2
  147. {
  148. public:
  149. list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {}
  150. A1 operator[] (boost::arg<1>) const { return a1_; }
  151. A2 operator[] (boost::arg<2>) const { return a2_; }
  152. A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
  153. A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
  154. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  155. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  156. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  157. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  158. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  159. template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
  160. {
  161. return unwrap(f, 0)(a[a1_], a[a2_]);
  162. }
  163. template<class V> void accept(V & v) const
  164. {
  165. BOOST_BIND_VISIT_EACH(v, a1_, 0);
  166. BOOST_BIND_VISIT_EACH(v, a2_, 0);
  167. }
  168. #ifdef BOOST_NO_VOID_RETURNS
  169. template<class R> struct evaluator
  170. {
  171. typedef evaluator2<R> type;
  172. };
  173. #else
  174. private:
  175. #endif
  176. A1 a1_;
  177. A2 a2_;
  178. };
  179. template<class A1, class A2, class A3> class list3
  180. {
  181. public:
  182. list3(A1 a1, A2 a2, A3 a3): a1_(a1), a2_(a2), a3_(a3) {}
  183. A1 operator[] (boost::arg<1>) const { return a1_; }
  184. A2 operator[] (boost::arg<2>) const { return a2_; }
  185. A3 operator[] (boost::arg<3>) const { return a3_; }
  186. A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
  187. A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
  188. A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
  189. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  190. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  191. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  192. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  193. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  194. template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
  195. {
  196. return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
  197. }
  198. template<class V> void accept(V & v) const
  199. {
  200. BOOST_BIND_VISIT_EACH(v, a1_, 0);
  201. BOOST_BIND_VISIT_EACH(v, a2_, 0);
  202. BOOST_BIND_VISIT_EACH(v, a3_, 0);
  203. }
  204. #ifdef BOOST_NO_VOID_RETURNS
  205. template<class R> struct evaluator
  206. {
  207. typedef evaluator3<R> type;
  208. };
  209. #else
  210. private:
  211. #endif
  212. A1 a1_;
  213. A2 a2_;
  214. A3 a3_;
  215. };
  216. template<class A1, class A2, class A3, class A4> class list4
  217. {
  218. public:
  219. list4(A1 a1, A2 a2, A3 a3, A4 a4): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {}
  220. A1 operator[] (boost::arg<1>) const { return a1_; }
  221. A2 operator[] (boost::arg<2>) const { return a2_; }
  222. A3 operator[] (boost::arg<3>) const { return a3_; }
  223. A4 operator[] (boost::arg<4>) const { return a4_; }
  224. A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
  225. A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
  226. A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
  227. A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
  228. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  229. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  230. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  231. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  232. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  233. template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
  234. {
  235. return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
  236. }
  237. template<class V> void accept(V & v) const
  238. {
  239. BOOST_BIND_VISIT_EACH(v, a1_, 0);
  240. BOOST_BIND_VISIT_EACH(v, a2_, 0);
  241. BOOST_BIND_VISIT_EACH(v, a3_, 0);
  242. BOOST_BIND_VISIT_EACH(v, a4_, 0);
  243. }
  244. #ifdef BOOST_NO_VOID_RETURNS
  245. template<class R> struct evaluator
  246. {
  247. typedef evaluator4<R> type;
  248. };
  249. #else
  250. private:
  251. #endif
  252. A1 a1_;
  253. A2 a2_;
  254. A3 a3_;
  255. A4 a4_;
  256. };
  257. template<class A1, class A2, class A3, class A4, class A5> class list5
  258. {
  259. public:
  260. list5(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {}
  261. A1 operator[] (boost::arg<1>) const { return a1_; }
  262. A2 operator[] (boost::arg<2>) const { return a2_; }
  263. A3 operator[] (boost::arg<3>) const { return a3_; }
  264. A4 operator[] (boost::arg<4>) const { return a4_; }
  265. A5 operator[] (boost::arg<5>) const { return a5_; }
  266. A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
  267. A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
  268. A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
  269. A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
  270. A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
  271. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  272. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  273. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  274. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  275. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  276. template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
  277. {
  278. return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
  279. }
  280. template<class V> void accept(V & v) const
  281. {
  282. BOOST_BIND_VISIT_EACH(v, a1_, 0);
  283. BOOST_BIND_VISIT_EACH(v, a2_, 0);
  284. BOOST_BIND_VISIT_EACH(v, a3_, 0);
  285. BOOST_BIND_VISIT_EACH(v, a4_, 0);
  286. BOOST_BIND_VISIT_EACH(v, a5_, 0);
  287. }
  288. #ifdef BOOST_NO_VOID_RETURNS
  289. template<class R> struct evaluator
  290. {
  291. typedef evaluator5<R> type;
  292. };
  293. #else
  294. private:
  295. #endif
  296. A1 a1_;
  297. A2 a2_;
  298. A3 a3_;
  299. A4 a4_;
  300. A5 a5_;
  301. };
  302. template<class A1, class A2, class A3, class A4, class A5, class A6> class list6
  303. {
  304. public:
  305. list6(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6) {}
  306. A1 operator[] (boost::arg<1>) const { return a1_; }
  307. A2 operator[] (boost::arg<2>) const { return a2_; }
  308. A3 operator[] (boost::arg<3>) const { return a3_; }
  309. A4 operator[] (boost::arg<4>) const { return a4_; }
  310. A5 operator[] (boost::arg<5>) const { return a5_; }
  311. A6 operator[] (boost::arg<6>) const { return a6_; }
  312. A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
  313. A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
  314. A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
  315. A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
  316. A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
  317. A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
  318. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  319. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  320. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  321. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  322. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  323. template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
  324. {
  325. return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
  326. }
  327. template<class V> void accept(V & v) const
  328. {
  329. BOOST_BIND_VISIT_EACH(v, a1_, 0);
  330. BOOST_BIND_VISIT_EACH(v, a2_, 0);
  331. BOOST_BIND_VISIT_EACH(v, a3_, 0);
  332. BOOST_BIND_VISIT_EACH(v, a4_, 0);
  333. BOOST_BIND_VISIT_EACH(v, a5_, 0);
  334. BOOST_BIND_VISIT_EACH(v, a6_, 0);
  335. }
  336. #ifdef BOOST_NO_VOID_RETURNS
  337. template<class R> struct evaluator
  338. {
  339. typedef evaluator6<R> type;
  340. };
  341. #else
  342. private:
  343. #endif
  344. A1 a1_;
  345. A2 a2_;
  346. A3 a3_;
  347. A4 a4_;
  348. A5 a5_;
  349. A6 a6_;
  350. };
  351. template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7
  352. {
  353. public:
  354. list7(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7) {}
  355. A1 operator[] (boost::arg<1>) const { return a1_; }
  356. A2 operator[] (boost::arg<2>) const { return a2_; }
  357. A3 operator[] (boost::arg<3>) const { return a3_; }
  358. A4 operator[] (boost::arg<4>) const { return a4_; }
  359. A5 operator[] (boost::arg<5>) const { return a5_; }
  360. A6 operator[] (boost::arg<6>) const { return a6_; }
  361. A7 operator[] (boost::arg<7>) const { return a7_; }
  362. A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
  363. A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
  364. A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
  365. A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
  366. A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
  367. A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
  368. A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
  369. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  370. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  371. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  372. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  373. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  374. template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
  375. {
  376. return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
  377. }
  378. template<class V> void accept(V & v) const
  379. {
  380. BOOST_BIND_VISIT_EACH(v, a1_, 0);
  381. BOOST_BIND_VISIT_EACH(v, a2_, 0);
  382. BOOST_BIND_VISIT_EACH(v, a3_, 0);
  383. BOOST_BIND_VISIT_EACH(v, a4_, 0);
  384. BOOST_BIND_VISIT_EACH(v, a5_, 0);
  385. BOOST_BIND_VISIT_EACH(v, a6_, 0);
  386. BOOST_BIND_VISIT_EACH(v, a7_, 0);
  387. }
  388. #ifdef BOOST_NO_VOID_RETURNS
  389. template<class R> struct evaluator
  390. {
  391. typedef evaluator7<R> type;
  392. };
  393. #else
  394. private:
  395. #endif
  396. A1 a1_;
  397. A2 a2_;
  398. A3 a3_;
  399. A4 a4_;
  400. A5 a5_;
  401. A6 a6_;
  402. A7 a7_;
  403. };
  404. template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class list8
  405. {
  406. public:
  407. list8(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7), a8_(a8) {}
  408. A1 operator[] (boost::arg<1>) const { return a1_; }
  409. A2 operator[] (boost::arg<2>) const { return a2_; }
  410. A3 operator[] (boost::arg<3>) const { return a3_; }
  411. A4 operator[] (boost::arg<4>) const { return a4_; }
  412. A5 operator[] (boost::arg<5>) const { return a5_; }
  413. A6 operator[] (boost::arg<6>) const { return a6_; }
  414. A7 operator[] (boost::arg<7>) const { return a7_; }
  415. A8 operator[] (boost::arg<8>) const { return a8_; }
  416. A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
  417. A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
  418. A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
  419. A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
  420. A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
  421. A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
  422. A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
  423. A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
  424. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  425. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  426. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  427. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  428. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  429. template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
  430. {
  431. return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
  432. }
  433. template<class V> void accept(V & v) const
  434. {
  435. BOOST_BIND_VISIT_EACH(v, a1_, 0);
  436. BOOST_BIND_VISIT_EACH(v, a2_, 0);
  437. BOOST_BIND_VISIT_EACH(v, a3_, 0);
  438. BOOST_BIND_VISIT_EACH(v, a4_, 0);
  439. BOOST_BIND_VISIT_EACH(v, a5_, 0);
  440. BOOST_BIND_VISIT_EACH(v, a6_, 0);
  441. BOOST_BIND_VISIT_EACH(v, a7_, 0);
  442. BOOST_BIND_VISIT_EACH(v, a8_, 0);
  443. }
  444. #ifdef BOOST_NO_VOID_RETURNS
  445. template<class R> struct evaluator
  446. {
  447. typedef evaluator8<R> type;
  448. };
  449. #else
  450. private:
  451. #endif
  452. A1 a1_;
  453. A2 a2_;
  454. A3 a3_;
  455. A4 a4_;
  456. A5 a5_;
  457. A6 a6_;
  458. A7 a7_;
  459. A8 a8_;
  460. };
  461. template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9
  462. {
  463. public:
  464. list9(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7), a8_(a8), a9_(a9) {}
  465. A1 operator[] (boost::arg<1>) const { return a1_; }
  466. A2 operator[] (boost::arg<2>) const { return a2_; }
  467. A3 operator[] (boost::arg<3>) const { return a3_; }
  468. A4 operator[] (boost::arg<4>) const { return a4_; }
  469. A5 operator[] (boost::arg<5>) const { return a5_; }
  470. A6 operator[] (boost::arg<6>) const { return a6_; }
  471. A7 operator[] (boost::arg<7>) const { return a7_; }
  472. A8 operator[] (boost::arg<8>) const { return a8_; }
  473. A9 operator[] (boost::arg<9>) const { return a9_; }
  474. A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
  475. A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
  476. A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
  477. A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
  478. A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
  479. A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
  480. A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
  481. A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
  482. A9 operator[] (boost::arg<9> (*) ()) const { return a9_; }
  483. template<class T> T & operator[] (value<T> & v) const { return v.get(); }
  484. template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
  485. template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
  486. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
  487. template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
  488. template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
  489. {
  490. return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
  491. }
  492. template<class V> void accept(V & v) const
  493. {
  494. BOOST_BIND_VISIT_EACH(v, a1_, 0);
  495. BOOST_BIND_VISIT_EACH(v, a2_, 0);
  496. BOOST_BIND_VISIT_EACH(v, a3_, 0);
  497. BOOST_BIND_VISIT_EACH(v, a4_, 0);
  498. BOOST_BIND_VISIT_EACH(v, a5_, 0);
  499. BOOST_BIND_VISIT_EACH(v, a6_, 0);
  500. BOOST_BIND_VISIT_EACH(v, a7_, 0);
  501. BOOST_BIND_VISIT_EACH(v, a8_, 0);
  502. BOOST_BIND_VISIT_EACH(v, a9_, 0);
  503. }
  504. #ifdef BOOST_NO_VOID_RETURNS
  505. template<class R> struct evaluator
  506. {
  507. typedef evaluator9<R> type;
  508. };
  509. #else
  510. private:
  511. #endif
  512. A1 a1_;
  513. A2 a2_;
  514. A3 a3_;
  515. A4 a4_;
  516. A5 a5_;
  517. A6 a6_;
  518. A7 a7_;
  519. A8 a8_;
  520. A9 a9_;
  521. };
  522. #ifdef BOOST_NO_VOID_RETURNS
  523. template <class R> struct evaluator0
  524. {
  525. template<class L, class F, class A>
  526. static R eval(L const&, F f, A &)
  527. {
  528. return unwrap(f, 0)();
  529. }
  530. };
  531. template <> struct evaluator0<void>
  532. {
  533. template<class L, class F, class A>
  534. static void eval(L const&, F f, A &)
  535. {
  536. unwrap(f, 0)();
  537. }
  538. };
  539. template <class R> struct evaluator1
  540. {
  541. template<class L, class F, class A>
  542. static R eval(L const& l, F f, A & a)
  543. {
  544. return unwrap(f, 0)(a[l.a1_]);
  545. }
  546. };
  547. template <> struct evaluator1<void>
  548. {
  549. template<class L, class F, class A>
  550. static void eval(L const& l, F f, A & a)
  551. {
  552. unwrap(f, 0)(a[l.a1_]);
  553. }
  554. };
  555. template <class R> struct evaluator2
  556. {
  557. template<class L, class F, class A>
  558. static R eval(L const& l, F f, A & a)
  559. {
  560. return unwrap(f, 0)(a[l.a1_], a[l.a2_]);
  561. }
  562. };
  563. template <> struct evaluator2<void>
  564. {
  565. template<class L, class F, class A>
  566. static void eval(L const& l, F f, A & a)
  567. {
  568. unwrap(f, 0)(a[l.a1_], a[l.a2_]);
  569. }
  570. };
  571. template <class R> struct evaluator3
  572. {
  573. template<class L, class F, class A>
  574. static R eval(L const& l, F f, A & a)
  575. {
  576. return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
  577. }
  578. };
  579. template <> struct evaluator3<void>
  580. {
  581. template<class L, class F, class A>
  582. static void eval(L const& l, F f, A & a)
  583. {
  584. unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
  585. }
  586. };
  587. template <class R> struct evaluator4
  588. {
  589. template<class L, class F, class A>
  590. static R eval(L const& l, F f, A & a)
  591. {
  592. return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
  593. }
  594. };
  595. template <> struct evaluator4<void>
  596. {
  597. template<class L, class F, class A>
  598. static void eval(L const& l, F f, A & a)
  599. {
  600. unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
  601. }
  602. };
  603. template <class R> struct evaluator5
  604. {
  605. template<class L, class F, class A>
  606. static R eval(L const& l, F f, A & a)
  607. {
  608. return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
  609. }
  610. };
  611. template <> struct evaluator5<void>
  612. {
  613. template<class L, class F, class A>
  614. static void eval(L const& l, F f, A & a)
  615. {
  616. unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
  617. }
  618. };
  619. template <class R> struct evaluator6
  620. {
  621. template<class L, class F, class A>
  622. static R eval(L const& l, F f, A & a)
  623. {
  624. return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
  625. }
  626. };
  627. template <> struct evaluator6<void>
  628. {
  629. template<class L, class F, class A>
  630. static void eval(L const& l, F f, A & a)
  631. {
  632. unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
  633. }
  634. };
  635. template <class R> struct evaluator7
  636. {
  637. template<class L, class F, class A>
  638. static R eval(L const& l, F f, A & a)
  639. {
  640. return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
  641. }
  642. };
  643. template <> struct evaluator7<void>
  644. {
  645. template<class L, class F, class A>
  646. static void eval(L const& l, F f, A & a)
  647. {
  648. unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
  649. }
  650. };
  651. template <class R> struct evaluator8
  652. {
  653. template<class L, class F, class A>
  654. static R eval(L const& l, F f, A & a)
  655. {
  656. return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
  657. }
  658. };
  659. template <> struct evaluator8<void>
  660. {
  661. template<class L, class F, class A>
  662. static void eval(L const& l, F f, A & a)
  663. {
  664. unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
  665. }
  666. };
  667. template <class R> struct evaluator9
  668. {
  669. template<class L, class F, class A>
  670. static R eval(L const& l, F f, A & a)
  671. {
  672. return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]);
  673. }
  674. };
  675. template <> struct evaluator9<void>
  676. {
  677. template<class L, class F, class A>
  678. static void eval(L const& l, F f, A & a)
  679. {
  680. unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]);
  681. }
  682. };
  683. #endif
  684. // bind_t
  685. #ifndef BOOST_NO_VOID_RETURNS
  686. template<class R, class F, class L> class bind_t
  687. {
  688. public:
  689. bind_t(F f, L const & l): f_(f), l_(l) {}
  690. #define BOOST_BIND_EVALUATE return l_(type<result_type>(), f_, a)
  691. #include <boost/bind/bind_template.hpp>
  692. #undef BOOST_BIND_EVALUATE
  693. };
  694. #else
  695. template<class R> struct bind_t_generator
  696. {
  697. template<class F, class L> class implementation
  698. {
  699. public:
  700. implementation(F f, L const & l): f_(f), l_(l) {}
  701. #define BOOST_BIND_EVALUATE return L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
  702. #include <boost/bind/bind_template.hpp>
  703. #undef BOOST_BIND_EVALUATE
  704. };
  705. };
  706. template<> struct bind_t_generator<void>
  707. {
  708. template<class F, class L> class implementation
  709. {
  710. private:
  711. typedef void R;
  712. public:
  713. implementation(F f, L const & l): f_(f), l_(l) {}
  714. #define BOOST_BIND_EVALUATE L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
  715. #include <boost/bind/bind_template.hpp>
  716. #undef BOOST_BIND_EVALUATE
  717. };
  718. };
  719. template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
  720. {
  721. public:
  722. bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
  723. };
  724. #endif
  725. // add_value
  726. #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
  727. template<class T> struct add_value
  728. {
  729. typedef value<T> type;
  730. };
  731. template<class T> struct add_value< value<T> >
  732. {
  733. typedef value<T> type;
  734. };
  735. template<class T> struct add_value< reference_wrapper<T> >
  736. {
  737. typedef reference_wrapper<T> type;
  738. };
  739. template<int I> struct add_value< arg<I> >
  740. {
  741. typedef boost::arg<I> type;
  742. };
  743. template<int I> struct add_value< arg<I> (*) () >
  744. {
  745. typedef boost::arg<I> (*type) ();
  746. };
  747. template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
  748. {
  749. typedef bind_t<R, F, L> type;
  750. };
  751. #else
  752. template<int I> struct _avt_0;
  753. template<> struct _avt_0<1>
  754. {
  755. template<class T> struct inner
  756. {
  757. typedef T type;
  758. };
  759. };
  760. template<> struct _avt_0<2>
  761. {
  762. template<class T> struct inner
  763. {
  764. typedef value<T> type;
  765. };
  766. };
  767. typedef char (&_avt_r1) [1];
  768. typedef char (&_avt_r2) [2];
  769. template<class T> _avt_r1 _avt_f(value<T>);
  770. template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
  771. template<int I> _avt_r1 _avt_f(arg<I>);
  772. template<int I> _avt_r1 _avt_f(arg<I> (*) ());
  773. template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
  774. _avt_r2 _avt_f(...);
  775. template<class T> struct add_value
  776. {
  777. static T t();
  778. typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
  779. };
  780. #endif
  781. // list_av_N
  782. template<class A1> struct list_av_1
  783. {
  784. typedef typename add_value<A1>::type B1;
  785. typedef list1<B1> type;
  786. };
  787. template<class A1, class A2> struct list_av_2
  788. {
  789. typedef typename add_value<A1>::type B1;
  790. typedef typename add_value<A2>::type B2;
  791. typedef list2<B1, B2> type;
  792. };
  793. template<class A1, class A2, class A3> struct list_av_3
  794. {
  795. typedef typename add_value<A1>::type B1;
  796. typedef typename add_value<A2>::type B2;
  797. typedef typename add_value<A3>::type B3;
  798. typedef list3<B1, B2, B3> type;
  799. };
  800. template<class A1, class A2, class A3, class A4> struct list_av_4
  801. {
  802. typedef typename add_value<A1>::type B1;
  803. typedef typename add_value<A2>::type B2;
  804. typedef typename add_value<A3>::type B3;
  805. typedef typename add_value<A4>::type B4;
  806. typedef list4<B1, B2, B3, B4> type;
  807. };
  808. template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
  809. {
  810. typedef typename add_value<A1>::type B1;
  811. typedef typename add_value<A2>::type B2;
  812. typedef typename add_value<A3>::type B3;
  813. typedef typename add_value<A4>::type B4;
  814. typedef typename add_value<A5>::type B5;
  815. typedef list5<B1, B2, B3, B4, B5> type;
  816. };
  817. template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
  818. {
  819. typedef typename add_value<A1>::type B1;
  820. typedef typename add_value<A2>::type B2;
  821. typedef typename add_value<A3>::type B3;
  822. typedef typename add_value<A4>::type B4;
  823. typedef typename add_value<A5>::type B5;
  824. typedef typename add_value<A6>::type B6;
  825. typedef list6<B1, B2, B3, B4, B5, B6> type;
  826. };
  827. template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
  828. {
  829. typedef typename add_value<A1>::type B1;
  830. typedef typename add_value<A2>::type B2;
  831. typedef typename add_value<A3>::type B3;
  832. typedef typename add_value<A4>::type B4;
  833. typedef typename add_value<A5>::type B5;
  834. typedef typename add_value<A6>::type B6;
  835. typedef typename add_value<A7>::type B7;
  836. typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
  837. };
  838. template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
  839. {
  840. typedef typename add_value<A1>::type B1;
  841. typedef typename add_value<A2>::type B2;
  842. typedef typename add_value<A3>::type B3;
  843. typedef typename add_value<A4>::type B4;
  844. typedef typename add_value<A5>::type B5;
  845. typedef typename add_value<A6>::type B6;
  846. typedef typename add_value<A7>::type B7;
  847. typedef typename add_value<A8>::type B8;
  848. typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
  849. };
  850. template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
  851. {
  852. typedef typename add_value<A1>::type B1;
  853. typedef typename add_value<A2>::type B2;
  854. typedef typename add_value<A3>::type B3;
  855. typedef typename add_value<A4>::type B4;
  856. typedef typename add_value<A5>::type B5;
  857. typedef typename add_value<A6>::type B6;
  858. typedef typename add_value<A7>::type B7;
  859. typedef typename add_value<A8>::type B8;
  860. typedef typename add_value<A9>::type B9;
  861. typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
  862. };
  863. // g++ 2.95 specific helper; used by the data member overload
  864. template<class T> struct add_cref
  865. {
  866. typedef T const & type;
  867. };
  868. template<> struct add_cref<void>
  869. {
  870. typedef void type;
  871. };
  872. } // namespace _bi
  873. // visit_each
  874. template<class V, class T> void visit_each(V & v, _bi::value<T> const & t, int)
  875. {
  876. BOOST_BIND_VISIT_EACH(v, t.get(), 0);
  877. }
  878. template<class V, class R, class F, class L> void visit_each(V & v, _bi::bind_t<R, F, L> const & t, int)
  879. {
  880. t.accept(v);
  881. }
  882. // bind
  883. #ifndef BOOST_BIND
  884. #define BOOST_BIND bind
  885. #endif
  886. // generic function objects
  887. template<class R, class F>
  888. _bi::bind_t<R, F, _bi::list0>
  889. BOOST_BIND(F f)
  890. {
  891. typedef _bi::list0 list_type;
  892. return _bi::bind_t<R, F, list_type> (f, list_type());
  893. }
  894. template<class R, class F, class A1>
  895. _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
  896. BOOST_BIND(F f, A1 a1)
  897. {
  898. typedef typename _bi::list_av_1<A1>::type list_type;
  899. return _bi::bind_t<R, F, list_type> (f, list_type(a1));
  900. }
  901. template<class R, class F, class A1, class A2>
  902. _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
  903. BOOST_BIND(F f, A1 a1, A2 a2)
  904. {
  905. typedef typename _bi::list_av_2<A1, A2>::type list_type;
  906. return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
  907. }
  908. template<class R, class F, class A1, class A2, class A3>
  909. _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
  910. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
  911. {
  912. typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
  913. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
  914. }
  915. template<class R, class F, class A1, class A2, class A3, class A4>
  916. _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
  917. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
  918. {
  919. typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
  920. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
  921. }
  922. template<class R, class F, class A1, class A2, class A3, class A4, class A5>
  923. _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
  924. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
  925. {
  926. typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
  927. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
  928. }
  929. template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
  930. _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
  931. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
  932. {
  933. typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
  934. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
  935. }
  936. template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
  937. _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
  938. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
  939. {
  940. typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
  941. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
  942. }
  943. template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
  944. _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
  945. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
  946. {
  947. typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
  948. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
  949. }
  950. template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
  951. _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
  952. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
  953. {
  954. typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
  955. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
  956. }
  957. // generic function objects, alternative syntax
  958. template<class R, class F>
  959. _bi::bind_t<R, F, _bi::list0>
  960. BOOST_BIND(boost::type<R>, F f)
  961. {
  962. typedef _bi::list0 list_type;
  963. return _bi::bind_t<R, F, list_type> (f, list_type());
  964. }
  965. template<class R, class F, class A1>
  966. _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
  967. BOOST_BIND(boost::type<R>, F f, A1 a1)
  968. {
  969. typedef typename _bi::list_av_1<A1>::type list_type;
  970. return _bi::bind_t<R, F, list_type> (f, list_type(a1));
  971. }
  972. template<class R, class F, class A1, class A2>
  973. _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
  974. BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
  975. {
  976. typedef typename _bi::list_av_2<A1, A2>::type list_type;
  977. return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
  978. }
  979. template<class R, class F, class A1, class A2, class A3>
  980. _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
  981. BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
  982. {
  983. typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
  984. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
  985. }
  986. template<class R, class F, class A1, class A2, class A3, class A4>
  987. _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
  988. BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
  989. {
  990. typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
  991. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
  992. }
  993. template<class R, class F, class A1, class A2, class A3, class A4, class A5>
  994. _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
  995. BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
  996. {
  997. typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
  998. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
  999. }
  1000. template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
  1001. _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
  1002. BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
  1003. {
  1004. typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
  1005. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
  1006. }
  1007. template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
  1008. _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
  1009. BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
  1010. {
  1011. typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
  1012. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
  1013. }
  1014. template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
  1015. _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
  1016. BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
  1017. {
  1018. typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
  1019. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
  1020. }
  1021. template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
  1022. _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
  1023. BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
  1024. {
  1025. typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
  1026. return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
  1027. }
  1028. #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
  1029. // adaptable function objects
  1030. template<class F>
  1031. _bi::bind_t<_bi::unspecified, F, _bi::list0>
  1032. BOOST_BIND(F f)
  1033. {
  1034. typedef _bi::list0 list_type;
  1035. return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
  1036. }
  1037. template<class F, class A1>
  1038. _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
  1039. BOOST_BIND(F f, A1 a1)
  1040. {
  1041. typedef typename _bi::list_av_1<A1>::type list_type;
  1042. return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
  1043. }
  1044. template<class F, class A1, class A2>
  1045. _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
  1046. BOOST_BIND(F f, A1 a1, A2 a2)
  1047. {
  1048. typedef typename _bi::list_av_2<A1, A2>::type list_type;
  1049. return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
  1050. }
  1051. template<class F, class A1, class A2, class A3>
  1052. _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
  1053. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
  1054. {
  1055. typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
  1056. return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
  1057. }
  1058. template<class F, class A1, class A2, class A3, class A4>
  1059. _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
  1060. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
  1061. {
  1062. typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
  1063. return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
  1064. }
  1065. template<class F, class A1, class A2, class A3, class A4, class A5>
  1066. _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
  1067. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
  1068. {
  1069. typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
  1070. return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
  1071. }
  1072. template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
  1073. _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
  1074. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
  1075. {
  1076. typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
  1077. return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
  1078. }
  1079. template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
  1080. _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
  1081. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
  1082. {
  1083. typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
  1084. return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
  1085. }
  1086. template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
  1087. _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
  1088. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
  1089. {
  1090. typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
  1091. return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
  1092. }
  1093. template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
  1094. _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
  1095. BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
  1096. {
  1097. typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
  1098. return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
  1099. }
  1100. #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
  1101. // function pointers
  1102. #define BOOST_BIND_CC
  1103. #define BOOST_BIND_ST
  1104. #include <boost/bind/bind_cc.hpp>
  1105. #undef BOOST_BIND_CC
  1106. #undef BOOST_BIND_ST
  1107. #ifdef BOOST_BIND_ENABLE_STDCALL
  1108. #define BOOST_BIND_CC __stdcall
  1109. #define BOOST_BIND_ST
  1110. #include <boost/bind/bind_cc.hpp>
  1111. #undef BOOST_BIND_CC
  1112. #undef BOOST_BIND_ST
  1113. #endif
  1114. #ifdef BOOST_BIND_ENABLE_FASTCALL
  1115. #define BOOST_BIND_CC __fastcall
  1116. #define BOOST_BIND_ST
  1117. #include <boost/bind/bind_cc.hpp>
  1118. #undef BOOST_BIND_CC
  1119. #undef BOOST_BIND_ST
  1120. #endif
  1121. #ifdef BOOST_BIND_ENABLE_PASCAL
  1122. #define BOOST_BIND_ST pascal
  1123. #define BOOST_BIND_CC
  1124. #include <boost/bind/bind_cc.hpp>
  1125. #undef BOOST_BIND_ST
  1126. #undef BOOST_BIND_CC
  1127. #endif
  1128. // member function pointers
  1129. #define BOOST_BIND_MF_NAME(X) X
  1130. #define BOOST_BIND_MF_CC
  1131. #include <boost/bind/bind_mf_cc.hpp>
  1132. #undef BOOST_BIND_MF_NAME
  1133. #undef BOOST_BIND_MF_CC
  1134. #ifdef BOOST_MEM_FN_ENABLE_STDCALL
  1135. #define BOOST_BIND_MF_NAME(X) X##_stdcall
  1136. #define BOOST_BIND_MF_CC __stdcall
  1137. #include <boost/bind/bind_mf_cc.hpp>
  1138. #undef BOOST_BIND_MF_NAME
  1139. #undef BOOST_BIND_MF_CC
  1140. #endif
  1141. #ifdef BOOST_MEM_FN_ENABLE_FASTCALL
  1142. #define BOOST_BIND_MF_NAME(X) X##_fastcall
  1143. #define BOOST_BIND_MF_CC __fastcall
  1144. #include <boost/bind/bind_mf_cc.hpp>
  1145. #undef BOOST_BIND_MF_NAME
  1146. #undef BOOST_BIND_MF_CC
  1147. #endif
  1148. // data member pointers
  1149. #if defined(__GNUC__) && (__GNUC__ == 2)
  1150. template<class R, class T, class A1>
  1151. _bi::bind_t< typename _bi::add_cref<R>::type, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
  1152. BOOST_BIND(R T::*f, A1 a1)
  1153. {
  1154. typedef _mfi::dm<R, T> F;
  1155. typedef typename _bi::list_av_1<A1>::type list_type;
  1156. return _bi::bind_t<typename _bi::add_cref<R>::type, F, list_type>(F(f), list_type(a1));
  1157. }
  1158. #else
  1159. template<class R, class T, class A1>
  1160. _bi::bind_t< R const &, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
  1161. BOOST_BIND(R T::*f, A1 a1)
  1162. {
  1163. typedef _mfi::dm<R, T> F;
  1164. typedef typename _bi::list_av_1<A1>::type list_type;
  1165. return _bi::bind_t<R const &, F, list_type>(F(f), list_type(a1));
  1166. }
  1167. #endif
  1168. } // namespace boost
  1169. #ifndef BOOST_BIND_NO_PLACEHOLDERS
  1170. # include <boost/bind/placeholders.hpp>
  1171. #endif
  1172. #ifdef BOOST_MSVC
  1173. # pragma warning(default: 4512) // assignment operator could not be generated
  1174. # pragma warning(pop)
  1175. #endif
  1176. #endif // #ifndef BOOST_BIND_HPP_INCLUDED