1 #ifndef BOOST_BIND_HPP_INCLUDED
2 #define BOOST_BIND_HPP_INCLUDED
9 // bind.hpp - binds function objects to arguments
11 // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
12 // Copyright (c) 2001 David Abrahams
14 // Permission to copy, use, modify, sell and distribute this software
15 // is granted provided this copyright notice appears in all copies.
16 // This software is provided "as is" without express or implied
17 // warranty, and with no claim as to its suitability for any purpose.
19 // See http://www.boost.org/libs/bind/bind.html for documentation.
22 #include <boost/config.hpp>
23 #include <boost/ref.hpp>
24 #include <boost/mem_fn.hpp>
25 #include <boost/type.hpp>
26 #include <boost/bind/arg.hpp>
28 // Borland-specific bug, visit_each() silently fails to produce code
30 #if defined(__BORLANDC__)
31 # define BOOST_BIND_VISIT_EACH boost::visit_each
33 # define BOOST_BIND_VISIT_EACH visit_each
37 # pragma warning(push)
38 # pragma warning(disable: 4512) // assignment operator could not be generated
44 namespace _bi // implementation details
49 template<class R, class F> struct result_traits
54 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
56 struct unspecified {};
58 template<class F> struct result_traits<unspecified, F>
60 typedef typename F::result_type type;
63 template<class F> struct result_traits< unspecified, reference_wrapper<F> >
65 typedef typename F::result_type type;
70 // bind_t forward declaration for listN
72 template<class R, class F, class L> class bind_t;
76 template<class T> class value
80 value(T const & t): t_(t) {}
82 T & get() { return t_; }
83 T const & get() const { return t_; }
92 template<class T> class type {};
96 template<class F> inline F & unwrap(F & f, long)
101 template<class F> inline F & unwrap(reference_wrapper<F> & f, int)
106 template<class F> inline F & unwrap(reference_wrapper<F> const & f, int)
113 #ifdef BOOST_NO_VOID_RETURNS
115 template <class R> struct evaluator0;
116 template <class R> struct evaluator1;
117 template <class R> struct evaluator2;
118 template <class R> struct evaluator3;
119 template <class R> struct evaluator4;
120 template <class R> struct evaluator5;
121 template <class R> struct evaluator6;
122 template <class R> struct evaluator7;
123 template <class R> struct evaluator8;
124 template <class R> struct evaluator9;
134 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
136 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
138 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
140 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); }
142 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); }
144 template<class R, class F, class A> R operator()(type<R>, F f, A &) const
146 return unwrap(f, 0)();
149 template<class V> void accept(V &) const
153 #ifdef BOOST_NO_VOID_RETURNS
155 template<class R> struct evaluator
157 typedef evaluator0<R> type;
164 template<class A1> class list1
168 explicit list1(A1 a1): a1_(a1) {}
170 A1 operator[] (boost::arg<1>) const { return a1_; }
172 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
174 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
176 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
178 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
180 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); }
182 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); }
184 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
186 return unwrap(f, 0)(a[a1_]);
189 template<class V> void accept(V & v) const
191 BOOST_BIND_VISIT_EACH(v, a1_, 0);
194 #ifdef BOOST_NO_VOID_RETURNS
196 template<class R> struct evaluator
198 typedef evaluator1<R> type;
210 template<class A1, class A2> class list2
214 list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {}
216 A1 operator[] (boost::arg<1>) const { return a1_; }
217 A2 operator[] (boost::arg<2>) const { return a2_; }
219 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
220 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
222 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
224 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
226 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
228 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); }
230 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); }
232 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
234 return unwrap(f, 0)(a[a1_], a[a2_]);
237 template<class V> void accept(V & v) const
239 BOOST_BIND_VISIT_EACH(v, a1_, 0);
240 BOOST_BIND_VISIT_EACH(v, a2_, 0);
243 #ifdef BOOST_NO_VOID_RETURNS
245 template<class R> struct evaluator
247 typedef evaluator2<R> type;
260 template<class A1, class A2, class A3> class list3
264 list3(A1 a1, A2 a2, A3 a3): a1_(a1), a2_(a2), a3_(a3) {}
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_; }
270 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
271 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
272 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
274 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
276 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
278 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
280 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); }
282 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); }
284 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
286 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
289 template<class V> void accept(V & v) const
291 BOOST_BIND_VISIT_EACH(v, a1_, 0);
292 BOOST_BIND_VISIT_EACH(v, a2_, 0);
293 BOOST_BIND_VISIT_EACH(v, a3_, 0);
296 #ifdef BOOST_NO_VOID_RETURNS
298 template<class R> struct evaluator
300 typedef evaluator3<R> type;
314 template<class A1, class A2, class A3, class A4> class list4
318 list4(A1 a1, A2 a2, A3 a3, A4 a4): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {}
320 A1 operator[] (boost::arg<1>) const { return a1_; }
321 A2 operator[] (boost::arg<2>) const { return a2_; }
322 A3 operator[] (boost::arg<3>) const { return a3_; }
323 A4 operator[] (boost::arg<4>) const { return a4_; }
325 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
326 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
327 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
328 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
330 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
332 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
334 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
336 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); }
338 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); }
340 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
342 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
345 template<class V> void accept(V & v) const
347 BOOST_BIND_VISIT_EACH(v, a1_, 0);
348 BOOST_BIND_VISIT_EACH(v, a2_, 0);
349 BOOST_BIND_VISIT_EACH(v, a3_, 0);
350 BOOST_BIND_VISIT_EACH(v, a4_, 0);
353 #ifdef BOOST_NO_VOID_RETURNS
355 template<class R> struct evaluator
357 typedef evaluator4<R> type;
372 template<class A1, class A2, class A3, class A4, class A5> class list5
376 list5(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {}
378 A1 operator[] (boost::arg<1>) const { return a1_; }
379 A2 operator[] (boost::arg<2>) const { return a2_; }
380 A3 operator[] (boost::arg<3>) const { return a3_; }
381 A4 operator[] (boost::arg<4>) const { return a4_; }
382 A5 operator[] (boost::arg<5>) const { return a5_; }
384 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
385 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
386 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
387 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
388 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
390 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
392 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
394 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
396 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); }
398 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); }
400 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
402 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
405 template<class V> void accept(V & v) const
407 BOOST_BIND_VISIT_EACH(v, a1_, 0);
408 BOOST_BIND_VISIT_EACH(v, a2_, 0);
409 BOOST_BIND_VISIT_EACH(v, a3_, 0);
410 BOOST_BIND_VISIT_EACH(v, a4_, 0);
411 BOOST_BIND_VISIT_EACH(v, a5_, 0);
414 #ifdef BOOST_NO_VOID_RETURNS
416 template<class R> struct evaluator
418 typedef evaluator5<R> type;
434 template<class A1, class A2, class A3, class A4, class A5, class A6> class list6
438 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) {}
440 A1 operator[] (boost::arg<1>) const { return a1_; }
441 A2 operator[] (boost::arg<2>) const { return a2_; }
442 A3 operator[] (boost::arg<3>) const { return a3_; }
443 A4 operator[] (boost::arg<4>) const { return a4_; }
444 A5 operator[] (boost::arg<5>) const { return a5_; }
445 A6 operator[] (boost::arg<6>) const { return a6_; }
447 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
448 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
449 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
450 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
451 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
452 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
454 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
456 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
458 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
460 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); }
462 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); }
464 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
466 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
469 template<class V> void accept(V & v) const
471 BOOST_BIND_VISIT_EACH(v, a1_, 0);
472 BOOST_BIND_VISIT_EACH(v, a2_, 0);
473 BOOST_BIND_VISIT_EACH(v, a3_, 0);
474 BOOST_BIND_VISIT_EACH(v, a4_, 0);
475 BOOST_BIND_VISIT_EACH(v, a5_, 0);
476 BOOST_BIND_VISIT_EACH(v, a6_, 0);
479 #ifdef BOOST_NO_VOID_RETURNS
481 template<class R> struct evaluator
483 typedef evaluator6<R> type;
500 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7
504 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) {}
506 A1 operator[] (boost::arg<1>) const { return a1_; }
507 A2 operator[] (boost::arg<2>) const { return a2_; }
508 A3 operator[] (boost::arg<3>) const { return a3_; }
509 A4 operator[] (boost::arg<4>) const { return a4_; }
510 A5 operator[] (boost::arg<5>) const { return a5_; }
511 A6 operator[] (boost::arg<6>) const { return a6_; }
512 A7 operator[] (boost::arg<7>) const { return a7_; }
514 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
515 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
516 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
517 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
518 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
519 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
520 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
522 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
524 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
526 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
528 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); }
530 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); }
532 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
534 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
537 template<class V> void accept(V & v) const
539 BOOST_BIND_VISIT_EACH(v, a1_, 0);
540 BOOST_BIND_VISIT_EACH(v, a2_, 0);
541 BOOST_BIND_VISIT_EACH(v, a3_, 0);
542 BOOST_BIND_VISIT_EACH(v, a4_, 0);
543 BOOST_BIND_VISIT_EACH(v, a5_, 0);
544 BOOST_BIND_VISIT_EACH(v, a6_, 0);
545 BOOST_BIND_VISIT_EACH(v, a7_, 0);
548 #ifdef BOOST_NO_VOID_RETURNS
550 template<class R> struct evaluator
552 typedef evaluator7<R> type;
570 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class list8
574 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) {}
576 A1 operator[] (boost::arg<1>) const { return a1_; }
577 A2 operator[] (boost::arg<2>) const { return a2_; }
578 A3 operator[] (boost::arg<3>) const { return a3_; }
579 A4 operator[] (boost::arg<4>) const { return a4_; }
580 A5 operator[] (boost::arg<5>) const { return a5_; }
581 A6 operator[] (boost::arg<6>) const { return a6_; }
582 A7 operator[] (boost::arg<7>) const { return a7_; }
583 A8 operator[] (boost::arg<8>) const { return a8_; }
585 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
586 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
587 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
588 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
589 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
590 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
591 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
592 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
594 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
596 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
598 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
600 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); }
602 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); }
604 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
606 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
609 template<class V> void accept(V & v) const
611 BOOST_BIND_VISIT_EACH(v, a1_, 0);
612 BOOST_BIND_VISIT_EACH(v, a2_, 0);
613 BOOST_BIND_VISIT_EACH(v, a3_, 0);
614 BOOST_BIND_VISIT_EACH(v, a4_, 0);
615 BOOST_BIND_VISIT_EACH(v, a5_, 0);
616 BOOST_BIND_VISIT_EACH(v, a6_, 0);
617 BOOST_BIND_VISIT_EACH(v, a7_, 0);
618 BOOST_BIND_VISIT_EACH(v, a8_, 0);
621 #ifdef BOOST_NO_VOID_RETURNS
623 template<class R> struct evaluator
625 typedef evaluator8<R> type;
644 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9
648 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) {}
650 A1 operator[] (boost::arg<1>) const { return a1_; }
651 A2 operator[] (boost::arg<2>) const { return a2_; }
652 A3 operator[] (boost::arg<3>) const { return a3_; }
653 A4 operator[] (boost::arg<4>) const { return a4_; }
654 A5 operator[] (boost::arg<5>) const { return a5_; }
655 A6 operator[] (boost::arg<6>) const { return a6_; }
656 A7 operator[] (boost::arg<7>) const { return a7_; }
657 A8 operator[] (boost::arg<8>) const { return a8_; }
658 A9 operator[] (boost::arg<9>) const { return a9_; }
660 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
661 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
662 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
663 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
664 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
665 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
666 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
667 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
668 A9 operator[] (boost::arg<9> (*) ()) const { return a9_; }
670 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
672 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
674 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
676 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); }
678 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); }
680 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
682 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
685 template<class V> void accept(V & v) const
687 BOOST_BIND_VISIT_EACH(v, a1_, 0);
688 BOOST_BIND_VISIT_EACH(v, a2_, 0);
689 BOOST_BIND_VISIT_EACH(v, a3_, 0);
690 BOOST_BIND_VISIT_EACH(v, a4_, 0);
691 BOOST_BIND_VISIT_EACH(v, a5_, 0);
692 BOOST_BIND_VISIT_EACH(v, a6_, 0);
693 BOOST_BIND_VISIT_EACH(v, a7_, 0);
694 BOOST_BIND_VISIT_EACH(v, a8_, 0);
695 BOOST_BIND_VISIT_EACH(v, a9_, 0);
698 #ifdef BOOST_NO_VOID_RETURNS
700 template<class R> struct evaluator
702 typedef evaluator9<R> type;
722 #ifdef BOOST_NO_VOID_RETURNS
724 template <class R> struct evaluator0
726 template<class L, class F, class A>
727 static R eval(L const&, F f, A &)
729 return unwrap(f, 0)();
733 template <> struct evaluator0<void>
735 template<class L, class F, class A>
736 static void eval(L const&, F f, A &)
742 template <class R> struct evaluator1
744 template<class L, class F, class A>
745 static R eval(L const& l, F f, A & a)
747 return unwrap(f, 0)(a[l.a1_]);
751 template <> struct evaluator1<void>
753 template<class L, class F, class A>
754 static void eval(L const& l, F f, A & a)
756 unwrap(f, 0)(a[l.a1_]);
760 template <class R> struct evaluator2
762 template<class L, class F, class A>
763 static R eval(L const& l, F f, A & a)
765 return unwrap(f, 0)(a[l.a1_], a[l.a2_]);
769 template <> struct evaluator2<void>
771 template<class L, class F, class A>
772 static void eval(L const& l, F f, A & a)
774 unwrap(f, 0)(a[l.a1_], a[l.a2_]);
778 template <class R> struct evaluator3
780 template<class L, class F, class A>
781 static R eval(L const& l, F f, A & a)
783 return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
787 template <> struct evaluator3<void>
789 template<class L, class F, class A>
790 static void eval(L const& l, F f, A & a)
792 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
796 template <class R> struct evaluator4
798 template<class L, class F, class A>
799 static R eval(L const& l, F f, A & a)
801 return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
805 template <> struct evaluator4<void>
807 template<class L, class F, class A>
808 static void eval(L const& l, F f, A & a)
810 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
814 template <class R> struct evaluator5
816 template<class L, class F, class A>
817 static R eval(L const& l, F f, A & a)
819 return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
823 template <> struct evaluator5<void>
825 template<class L, class F, class A>
826 static void eval(L const& l, F f, A & a)
828 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
832 template <class R> struct evaluator6
834 template<class L, class F, class A>
835 static R eval(L const& l, F f, A & a)
837 return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
841 template <> struct evaluator6<void>
843 template<class L, class F, class A>
844 static void eval(L const& l, F f, A & a)
846 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
850 template <class R> struct evaluator7
852 template<class L, class F, class A>
853 static R eval(L const& l, F f, A & a)
855 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_]);
859 template <> struct evaluator7<void>
861 template<class L, class F, class A>
862 static void eval(L const& l, F f, A & a)
864 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
868 template <class R> struct evaluator8
870 template<class L, class F, class A>
871 static R eval(L const& l, F f, A & a)
873 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_]);
877 template <> struct evaluator8<void>
879 template<class L, class F, class A>
880 static void eval(L const& l, F f, A & a)
882 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_]);
886 template <class R> struct evaluator9
888 template<class L, class F, class A>
889 static R eval(L const& l, F f, A & a)
891 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_]);
895 template <> struct evaluator9<void>
897 template<class L, class F, class A>
898 static void eval(L const& l, F f, A & a)
900 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_]);
908 #ifndef BOOST_NO_VOID_RETURNS
910 template<class R, class F, class L> class bind_t
914 bind_t(F f, L const & l): f_(f), l_(l) {}
916 #define BOOST_BIND_EVALUATE return l_(type<result_type>(), f_, a)
917 #include <boost/bind/bind_template.hpp>
918 #undef BOOST_BIND_EVALUATE
924 template<class R> struct bind_t_generator
927 template<class F, class L> class implementation
931 implementation(F f, L const & l): f_(f), l_(l) {}
933 #define BOOST_BIND_EVALUATE return L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
934 #include <boost/bind/bind_template.hpp>
935 #undef BOOST_BIND_EVALUATE
941 template<> struct bind_t_generator<void>
944 template<class F, class L> class implementation
952 implementation(F f, L const & l): f_(f), l_(l) {}
954 #define BOOST_BIND_EVALUATE L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
955 #include <boost/bind/bind_template.hpp>
956 #undef BOOST_BIND_EVALUATE
962 template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
966 bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
974 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
976 template<class T> struct add_value
978 typedef value<T> type;
981 template<class T> struct add_value< value<T> >
983 typedef value<T> type;
986 template<class T> struct add_value< reference_wrapper<T> >
988 typedef reference_wrapper<T> type;
991 template<int I> struct add_value< arg<I> >
993 typedef boost::arg<I> type;
996 template<int I> struct add_value< arg<I> (*) () >
998 typedef boost::arg<I> (*type) ();
1001 template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
1003 typedef bind_t<R, F, L> type;
1008 template<int I> struct _avt_0;
1010 template<> struct _avt_0<1>
1012 template<class T> struct inner
1018 template<> struct _avt_0<2>
1020 template<class T> struct inner
1022 typedef value<T> type;
1026 typedef char (&_avt_r1) [1];
1027 typedef char (&_avt_r2) [2];
1029 template<class T> _avt_r1 _avt_f(value<T>);
1030 template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
1031 template<int I> _avt_r1 _avt_f(arg<I>);
1032 template<int I> _avt_r1 _avt_f(arg<I> (*) ());
1033 template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
1035 _avt_r2 _avt_f(...);
1037 template<class T> struct add_value
1040 typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
1047 template<class A1> struct list_av_1
1049 typedef typename add_value<A1>::type B1;
1050 typedef list1<B1> type;
1053 template<class A1, class A2> struct list_av_2
1055 typedef typename add_value<A1>::type B1;
1056 typedef typename add_value<A2>::type B2;
1057 typedef list2<B1, B2> type;
1060 template<class A1, class A2, class A3> struct list_av_3
1062 typedef typename add_value<A1>::type B1;
1063 typedef typename add_value<A2>::type B2;
1064 typedef typename add_value<A3>::type B3;
1065 typedef list3<B1, B2, B3> type;
1068 template<class A1, class A2, class A3, class A4> struct list_av_4
1070 typedef typename add_value<A1>::type B1;
1071 typedef typename add_value<A2>::type B2;
1072 typedef typename add_value<A3>::type B3;
1073 typedef typename add_value<A4>::type B4;
1074 typedef list4<B1, B2, B3, B4> type;
1077 template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
1079 typedef typename add_value<A1>::type B1;
1080 typedef typename add_value<A2>::type B2;
1081 typedef typename add_value<A3>::type B3;
1082 typedef typename add_value<A4>::type B4;
1083 typedef typename add_value<A5>::type B5;
1084 typedef list5<B1, B2, B3, B4, B5> type;
1087 template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
1089 typedef typename add_value<A1>::type B1;
1090 typedef typename add_value<A2>::type B2;
1091 typedef typename add_value<A3>::type B3;
1092 typedef typename add_value<A4>::type B4;
1093 typedef typename add_value<A5>::type B5;
1094 typedef typename add_value<A6>::type B6;
1095 typedef list6<B1, B2, B3, B4, B5, B6> type;
1098 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
1100 typedef typename add_value<A1>::type B1;
1101 typedef typename add_value<A2>::type B2;
1102 typedef typename add_value<A3>::type B3;
1103 typedef typename add_value<A4>::type B4;
1104 typedef typename add_value<A5>::type B5;
1105 typedef typename add_value<A6>::type B6;
1106 typedef typename add_value<A7>::type B7;
1107 typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
1110 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
1112 typedef typename add_value<A1>::type B1;
1113 typedef typename add_value<A2>::type B2;
1114 typedef typename add_value<A3>::type B3;
1115 typedef typename add_value<A4>::type B4;
1116 typedef typename add_value<A5>::type B5;
1117 typedef typename add_value<A6>::type B6;
1118 typedef typename add_value<A7>::type B7;
1119 typedef typename add_value<A8>::type B8;
1120 typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
1123 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
1125 typedef typename add_value<A1>::type B1;
1126 typedef typename add_value<A2>::type B2;
1127 typedef typename add_value<A3>::type B3;
1128 typedef typename add_value<A4>::type B4;
1129 typedef typename add_value<A5>::type B5;
1130 typedef typename add_value<A6>::type B6;
1131 typedef typename add_value<A7>::type B7;
1132 typedef typename add_value<A8>::type B8;
1133 typedef typename add_value<A9>::type B9;
1134 typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
1137 // g++ 2.95 specific helper; used by the data member overload
1139 template<class T> struct add_cref
1141 typedef T const & type;
1144 template<> struct add_cref<void>
1153 template<class V, class T> void visit_each(V & v, _bi::value<T> const & t, int)
1155 BOOST_BIND_VISIT_EACH(v, t.get(), 0);
1158 template<class V, class R, class F, class L> void visit_each(V & v, _bi::bind_t<R, F, L> const & t, int)
1166 #define BOOST_BIND bind
1169 // generic function objects
1171 template<class R, class F>
1172 _bi::bind_t<R, F, _bi::list0>
1175 typedef _bi::list0 list_type;
1176 return _bi::bind_t<R, F, list_type> (f, list_type());
1179 template<class R, class F, class A1>
1180 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1181 BOOST_BIND(F f, A1 a1)
1183 typedef typename _bi::list_av_1<A1>::type list_type;
1184 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1187 template<class R, class F, class A1, class A2>
1188 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1189 BOOST_BIND(F f, A1 a1, A2 a2)
1191 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1192 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1195 template<class R, class F, class A1, class A2, class A3>
1196 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1197 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1199 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1200 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1203 template<class R, class F, class A1, class A2, class A3, class A4>
1204 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1205 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1207 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1208 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1211 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1212 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1213 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1215 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1216 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1219 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1220 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1221 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1223 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1224 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1227 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1228 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1229 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1231 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1232 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1235 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1236 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1237 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1239 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1240 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1243 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1244 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1245 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1247 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1248 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1251 // generic function objects, alternative syntax
1253 template<class R, class F>
1254 _bi::bind_t<R, F, _bi::list0>
1255 BOOST_BIND(boost::type<R>, F f)
1257 typedef _bi::list0 list_type;
1258 return _bi::bind_t<R, F, list_type> (f, list_type());
1261 template<class R, class F, class A1>
1262 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1263 BOOST_BIND(boost::type<R>, F f, A1 a1)
1265 typedef typename _bi::list_av_1<A1>::type list_type;
1266 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1269 template<class R, class F, class A1, class A2>
1270 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1271 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
1273 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1274 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1277 template<class R, class F, class A1, class A2, class A3>
1278 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1279 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
1281 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1282 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1285 template<class R, class F, class A1, class A2, class A3, class A4>
1286 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1287 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
1289 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1290 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1293 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1294 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1295 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1297 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1298 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1301 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1302 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1303 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1305 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1306 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1309 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1310 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1311 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1313 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1314 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1317 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1318 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1319 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1321 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1322 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1325 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1326 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1327 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)
1329 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1330 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1333 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1335 // adaptable function objects
1338 _bi::bind_t<_bi::unspecified, F, _bi::list0>
1341 typedef _bi::list0 list_type;
1342 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
1345 template<class F, class A1>
1346 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
1347 BOOST_BIND(F f, A1 a1)
1349 typedef typename _bi::list_av_1<A1>::type list_type;
1350 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
1353 template<class F, class A1, class A2>
1354 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
1355 BOOST_BIND(F f, A1 a1, A2 a2)
1357 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1358 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
1361 template<class F, class A1, class A2, class A3>
1362 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
1363 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1365 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1366 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
1369 template<class F, class A1, class A2, class A3, class A4>
1370 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1371 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1373 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1374 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
1377 template<class F, class A1, class A2, class A3, class A4, class A5>
1378 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1379 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1381 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1382 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1385 template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
1386 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1387 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1389 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1390 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1393 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1394 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1395 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1397 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1398 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1401 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1402 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1403 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1405 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1406 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1409 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1410 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1411 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1413 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1414 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1417 #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1419 // function pointers
1421 #define BOOST_BIND_CC
1422 #define BOOST_BIND_ST
1424 #include <boost/bind/bind_cc.hpp>
1426 #undef BOOST_BIND_CC
1427 #undef BOOST_BIND_ST
1429 #ifdef BOOST_BIND_ENABLE_STDCALL
1431 #define BOOST_BIND_CC __stdcall
1432 #define BOOST_BIND_ST
1434 #include <boost/bind/bind_cc.hpp>
1436 #undef BOOST_BIND_CC
1437 #undef BOOST_BIND_ST
1441 #ifdef BOOST_BIND_ENABLE_FASTCALL
1443 #define BOOST_BIND_CC __fastcall
1444 #define BOOST_BIND_ST
1446 #include <boost/bind/bind_cc.hpp>
1448 #undef BOOST_BIND_CC
1449 #undef BOOST_BIND_ST
1453 #ifdef BOOST_BIND_ENABLE_PASCAL
1455 #define BOOST_BIND_ST pascal
1456 #define BOOST_BIND_CC
1458 #include <boost/bind/bind_cc.hpp>
1460 #undef BOOST_BIND_ST
1461 #undef BOOST_BIND_CC
1465 // member function pointers
1467 #define BOOST_BIND_MF_NAME(X) X
1468 #define BOOST_BIND_MF_CC
1470 #include <boost/bind/bind_mf_cc.hpp>
1472 #undef BOOST_BIND_MF_NAME
1473 #undef BOOST_BIND_MF_CC
1475 #ifdef BOOST_MEM_FN_ENABLE_STDCALL
1477 #define BOOST_BIND_MF_NAME(X) X##_stdcall
1478 #define BOOST_BIND_MF_CC __stdcall
1480 #include <boost/bind/bind_mf_cc.hpp>
1482 #undef BOOST_BIND_MF_NAME
1483 #undef BOOST_BIND_MF_CC
1487 #ifdef BOOST_MEM_FN_ENABLE_FASTCALL
1489 #define BOOST_BIND_MF_NAME(X) X##_fastcall
1490 #define BOOST_BIND_MF_CC __fastcall
1492 #include <boost/bind/bind_mf_cc.hpp>
1494 #undef BOOST_BIND_MF_NAME
1495 #undef BOOST_BIND_MF_CC
1499 // data member pointers
1501 #if defined(__GNUC__) && (__GNUC__ == 2)
1503 template<class R, class T, class A1>
1504 _bi::bind_t< typename _bi::add_cref<R>::type, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1505 BOOST_BIND(R T::*f, A1 a1)
1507 typedef _mfi::dm<R, T> F;
1508 typedef typename _bi::list_av_1<A1>::type list_type;
1509 return _bi::bind_t<typename _bi::add_cref<R>::type, F, list_type>(F(f), list_type(a1));
1514 template<class R, class T, class A1>
1515 _bi::bind_t< R const &, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1516 BOOST_BIND(R T::*f, A1 a1)
1518 typedef _mfi::dm<R, T> F;
1519 typedef typename _bi::list_av_1<A1>::type list_type;
1520 return _bi::bind_t<R const &, F, list_type>(F(f), list_type(a1));
1525 } // namespace boost
1527 #ifndef BOOST_BIND_NO_PLACEHOLDERS
1529 # include <boost/bind/placeholders.hpp>
1534 # pragma warning(default: 4512) // assignment operator could not be generated
1535 # pragma warning(pop)
1538 #endif // #ifndef BOOST_BIND_HPP_INCLUDED