1 #ifndef BOOST_BIND_HPP_INCLUDED
2 #define BOOST_BIND_HPP_INCLUDED
4 // MS compatible compilers support #pragma once
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
11 // bind.hpp - binds function objects to arguments
13 // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
14 // Copyright (c) 2001 David Abrahams
16 // Permission to copy, use, modify, sell and distribute this software
17 // is granted provided this copyright notice appears in all copies.
18 // This software is provided "as is" without express or implied
19 // warranty, and with no claim as to its suitability for any purpose.
21 // See http://www.boost.org/libs/bind/bind.html for documentation.
24 #include <boost/config.hpp>
25 #include <boost/ref.hpp>
26 #include <boost/mem_fn.hpp>
27 #include <boost/type.hpp>
28 #include <boost/bind/arg.hpp>
30 // Borland-specific bug, visit_each() silently fails to produce code
32 #if defined(__BORLANDC__)
33 # define BOOST_BIND_VISIT_EACH boost::visit_each
35 # define BOOST_BIND_VISIT_EACH visit_each
39 # pragma warning(push)
40 # pragma warning(disable: 4512) // assignment operator could not be generated
46 namespace _bi // implementation details
51 template<class R, class F> struct result_traits
56 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
58 struct unspecified {};
60 template<class F> struct result_traits<unspecified, F>
62 typedef typename F::result_type type;
65 template<class F> struct result_traits< unspecified, reference_wrapper<F> >
67 typedef typename F::result_type type;
72 // bind_t forward declaration for listN
74 template<class R, class F, class L> class bind_t;
78 template<class T> class value
82 value(T const & t): t_(t) {}
84 T & get() { return t_; }
85 T const & get() const { return t_; }
94 template<class T> class type {};
98 template<class F> inline F & unwrap(F & f, long)
103 template<class F> inline F & unwrap(reference_wrapper<F> & f, int)
108 template<class F> inline F & unwrap(reference_wrapper<F> const & f, int)
115 #ifdef BOOST_NO_VOID_RETURNS
117 template <class R> struct evaluator0;
118 template <class R> struct evaluator1;
119 template <class R> struct evaluator2;
120 template <class R> struct evaluator3;
121 template <class R> struct evaluator4;
122 template <class R> struct evaluator5;
123 template <class R> struct evaluator6;
124 template <class R> struct evaluator7;
125 template <class R> struct evaluator8;
126 template <class R> struct evaluator9;
136 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
138 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
140 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
142 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); }
144 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); }
146 template<class R, class F, class A> R operator()(type<R>, F f, A &)
148 return unwrap(f, 0)();
151 template<class R, class F, class A> R operator()(type<R>, F f, A &) const
153 return unwrap(f, 0)();
156 template<class V> void accept(V &) const
160 #ifdef BOOST_NO_VOID_RETURNS
162 template<class R> struct evaluator
164 typedef evaluator0<R> type;
171 template<class A1> class list1
175 explicit list1(A1 a1): a1_(a1) {}
177 A1 operator[] (boost::arg<1>) const { return a1_; }
179 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
181 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
183 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
185 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
187 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); }
189 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); }
191 template<class R, class F, class A> R operator()(type<R>, F f, A & a)
193 return unwrap(f, 0)(a[a1_]);
196 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
198 return unwrap(f, 0)(a[a1_]);
201 template<class V> void accept(V & v) const
203 BOOST_BIND_VISIT_EACH(v, a1_, 0);
206 #ifdef BOOST_NO_VOID_RETURNS
208 template<class R> struct evaluator
210 typedef evaluator1<R> type;
222 template<class A1, class A2> class list2
226 list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {}
228 A1 operator[] (boost::arg<1>) const { return a1_; }
229 A2 operator[] (boost::arg<2>) const { return a2_; }
231 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
232 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
234 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
236 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
238 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
240 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); }
242 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); }
244 template<class R, class F, class A> R operator()(type<R>, F f, A & a)
246 return unwrap(f, 0)(a[a1_], a[a2_]);
249 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
251 return unwrap(f, 0)(a[a1_], a[a2_]);
254 template<class V> void accept(V & v) const
256 BOOST_BIND_VISIT_EACH(v, a1_, 0);
257 BOOST_BIND_VISIT_EACH(v, a2_, 0);
260 #ifdef BOOST_NO_VOID_RETURNS
262 template<class R> struct evaluator
264 typedef evaluator2<R> type;
277 template<class A1, class A2, class A3> class list3
281 list3(A1 a1, A2 a2, A3 a3): a1_(a1), a2_(a2), a3_(a3) {}
283 A1 operator[] (boost::arg<1>) const { return a1_; }
284 A2 operator[] (boost::arg<2>) const { return a2_; }
285 A3 operator[] (boost::arg<3>) const { return a3_; }
287 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
288 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
289 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
291 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
293 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
295 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
297 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); }
299 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); }
301 template<class R, class F, class A> R operator()(type<R>, F f, A & a)
303 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
306 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
308 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
311 template<class V> void accept(V & v) const
313 BOOST_BIND_VISIT_EACH(v, a1_, 0);
314 BOOST_BIND_VISIT_EACH(v, a2_, 0);
315 BOOST_BIND_VISIT_EACH(v, a3_, 0);
318 #ifdef BOOST_NO_VOID_RETURNS
320 template<class R> struct evaluator
322 typedef evaluator3<R> type;
336 template<class A1, class A2, class A3, class A4> class list4
340 list4(A1 a1, A2 a2, A3 a3, A4 a4): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {}
342 A1 operator[] (boost::arg<1>) const { return a1_; }
343 A2 operator[] (boost::arg<2>) const { return a2_; }
344 A3 operator[] (boost::arg<3>) const { return a3_; }
345 A4 operator[] (boost::arg<4>) const { return a4_; }
347 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
348 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
349 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
350 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
352 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
354 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
356 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
358 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); }
360 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); }
362 template<class R, class F, class A> R operator()(type<R>, F f, A & a)
364 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
367 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
369 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
372 template<class V> void accept(V & v) const
374 BOOST_BIND_VISIT_EACH(v, a1_, 0);
375 BOOST_BIND_VISIT_EACH(v, a2_, 0);
376 BOOST_BIND_VISIT_EACH(v, a3_, 0);
377 BOOST_BIND_VISIT_EACH(v, a4_, 0);
380 #ifdef BOOST_NO_VOID_RETURNS
382 template<class R> struct evaluator
384 typedef evaluator4<R> type;
399 template<class A1, class A2, class A3, class A4, class A5> class list5
403 list5(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {}
405 A1 operator[] (boost::arg<1>) const { return a1_; }
406 A2 operator[] (boost::arg<2>) const { return a2_; }
407 A3 operator[] (boost::arg<3>) const { return a3_; }
408 A4 operator[] (boost::arg<4>) const { return a4_; }
409 A5 operator[] (boost::arg<5>) const { return a5_; }
411 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
412 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
413 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
414 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
415 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
417 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
419 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
421 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
423 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); }
425 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); }
427 template<class R, class F, class A> R operator()(type<R>, F f, A & a)
429 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
432 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
434 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
437 template<class V> void accept(V & v) const
439 BOOST_BIND_VISIT_EACH(v, a1_, 0);
440 BOOST_BIND_VISIT_EACH(v, a2_, 0);
441 BOOST_BIND_VISIT_EACH(v, a3_, 0);
442 BOOST_BIND_VISIT_EACH(v, a4_, 0);
443 BOOST_BIND_VISIT_EACH(v, a5_, 0);
446 #ifdef BOOST_NO_VOID_RETURNS
448 template<class R> struct evaluator
450 typedef evaluator5<R> type;
466 template<class A1, class A2, class A3, class A4, class A5, class A6> class list6
470 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) {}
472 A1 operator[] (boost::arg<1>) const { return a1_; }
473 A2 operator[] (boost::arg<2>) const { return a2_; }
474 A3 operator[] (boost::arg<3>) const { return a3_; }
475 A4 operator[] (boost::arg<4>) const { return a4_; }
476 A5 operator[] (boost::arg<5>) const { return a5_; }
477 A6 operator[] (boost::arg<6>) const { return a6_; }
479 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
480 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
481 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
482 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
483 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
484 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
486 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
488 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
490 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
492 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); }
494 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); }
496 template<class R, class F, class A> R operator()(type<R>, F f, A & a)
498 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
501 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
503 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
506 template<class V> void accept(V & v) const
508 BOOST_BIND_VISIT_EACH(v, a1_, 0);
509 BOOST_BIND_VISIT_EACH(v, a2_, 0);
510 BOOST_BIND_VISIT_EACH(v, a3_, 0);
511 BOOST_BIND_VISIT_EACH(v, a4_, 0);
512 BOOST_BIND_VISIT_EACH(v, a5_, 0);
513 BOOST_BIND_VISIT_EACH(v, a6_, 0);
516 #ifdef BOOST_NO_VOID_RETURNS
518 template<class R> struct evaluator
520 typedef evaluator6<R> type;
537 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7
541 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) {}
543 A1 operator[] (boost::arg<1>) const { return a1_; }
544 A2 operator[] (boost::arg<2>) const { return a2_; }
545 A3 operator[] (boost::arg<3>) const { return a3_; }
546 A4 operator[] (boost::arg<4>) const { return a4_; }
547 A5 operator[] (boost::arg<5>) const { return a5_; }
548 A6 operator[] (boost::arg<6>) const { return a6_; }
549 A7 operator[] (boost::arg<7>) const { return a7_; }
551 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
552 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
553 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
554 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
555 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
556 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
557 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
559 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
561 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
563 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
565 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); }
567 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); }
569 template<class R, class F, class A> R operator()(type<R>, F f, A & a)
571 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
574 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
576 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
579 template<class V> void accept(V & v) const
581 BOOST_BIND_VISIT_EACH(v, a1_, 0);
582 BOOST_BIND_VISIT_EACH(v, a2_, 0);
583 BOOST_BIND_VISIT_EACH(v, a3_, 0);
584 BOOST_BIND_VISIT_EACH(v, a4_, 0);
585 BOOST_BIND_VISIT_EACH(v, a5_, 0);
586 BOOST_BIND_VISIT_EACH(v, a6_, 0);
587 BOOST_BIND_VISIT_EACH(v, a7_, 0);
590 #ifdef BOOST_NO_VOID_RETURNS
592 template<class R> struct evaluator
594 typedef evaluator7<R> type;
612 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class list8
616 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) {}
618 A1 operator[] (boost::arg<1>) const { return a1_; }
619 A2 operator[] (boost::arg<2>) const { return a2_; }
620 A3 operator[] (boost::arg<3>) const { return a3_; }
621 A4 operator[] (boost::arg<4>) const { return a4_; }
622 A5 operator[] (boost::arg<5>) const { return a5_; }
623 A6 operator[] (boost::arg<6>) const { return a6_; }
624 A7 operator[] (boost::arg<7>) const { return a7_; }
625 A8 operator[] (boost::arg<8>) const { return a8_; }
627 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
628 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
629 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
630 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
631 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
632 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
633 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
634 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
636 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
638 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
640 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
642 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); }
644 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); }
646 template<class R, class F, class A> R operator()(type<R>, F f, A & a)
648 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
651 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
653 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
656 template<class V> void accept(V & v) const
658 BOOST_BIND_VISIT_EACH(v, a1_, 0);
659 BOOST_BIND_VISIT_EACH(v, a2_, 0);
660 BOOST_BIND_VISIT_EACH(v, a3_, 0);
661 BOOST_BIND_VISIT_EACH(v, a4_, 0);
662 BOOST_BIND_VISIT_EACH(v, a5_, 0);
663 BOOST_BIND_VISIT_EACH(v, a6_, 0);
664 BOOST_BIND_VISIT_EACH(v, a7_, 0);
665 BOOST_BIND_VISIT_EACH(v, a8_, 0);
668 #ifdef BOOST_NO_VOID_RETURNS
670 template<class R> struct evaluator
672 typedef evaluator8<R> type;
691 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9
695 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) {}
697 A1 operator[] (boost::arg<1>) const { return a1_; }
698 A2 operator[] (boost::arg<2>) const { return a2_; }
699 A3 operator[] (boost::arg<3>) const { return a3_; }
700 A4 operator[] (boost::arg<4>) const { return a4_; }
701 A5 operator[] (boost::arg<5>) const { return a5_; }
702 A6 operator[] (boost::arg<6>) const { return a6_; }
703 A7 operator[] (boost::arg<7>) const { return a7_; }
704 A8 operator[] (boost::arg<8>) const { return a8_; }
705 A9 operator[] (boost::arg<9>) const { return a9_; }
707 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
708 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
709 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
710 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
711 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
712 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
713 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
714 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
715 A9 operator[] (boost::arg<9> (*) ()) const { return a9_; }
717 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
719 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
721 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
723 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); }
725 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); }
727 template<class R, class F, class A> R operator()(type<R>, F f, A & a)
729 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
732 template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
734 return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
737 template<class V> void accept(V & v) const
739 BOOST_BIND_VISIT_EACH(v, a1_, 0);
740 BOOST_BIND_VISIT_EACH(v, a2_, 0);
741 BOOST_BIND_VISIT_EACH(v, a3_, 0);
742 BOOST_BIND_VISIT_EACH(v, a4_, 0);
743 BOOST_BIND_VISIT_EACH(v, a5_, 0);
744 BOOST_BIND_VISIT_EACH(v, a6_, 0);
745 BOOST_BIND_VISIT_EACH(v, a7_, 0);
746 BOOST_BIND_VISIT_EACH(v, a8_, 0);
747 BOOST_BIND_VISIT_EACH(v, a9_, 0);
750 #ifdef BOOST_NO_VOID_RETURNS
752 template<class R> struct evaluator
754 typedef evaluator9<R> type;
774 #ifdef BOOST_NO_VOID_RETURNS
776 template <class R> struct evaluator0
778 template<class L, class F, class A>
779 static R eval(L &, F f, A &)
781 return unwrap(f, 0)();
785 template <> struct evaluator0<void>
787 template<class L, class F, class A>
788 static void eval(L &, F f, A &)
794 template <class R> struct evaluator1
796 template<class L, class F, class A>
797 static R eval(L & l, F f, A & a)
799 return unwrap(f, 0)(a[l.a1_]);
803 template <> struct evaluator1<void>
805 template<class L, class F, class A>
806 static void eval(L & l, F f, A & a)
808 unwrap(f, 0)(a[l.a1_]);
812 template <class R> struct evaluator2
814 template<class L, class F, class A>
815 static R eval(L & l, F f, A & a)
817 return unwrap(f, 0)(a[l.a1_], a[l.a2_]);
821 template <> struct evaluator2<void>
823 template<class L, class F, class A>
824 static void eval(L & l, F f, A & a)
826 unwrap(f, 0)(a[l.a1_], a[l.a2_]);
830 template <class R> struct evaluator3
832 template<class L, class F, class A>
833 static R eval(L & l, F f, A & a)
835 return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
839 template <> struct evaluator3<void>
841 template<class L, class F, class A>
842 static void eval(L & l, F f, A & a)
844 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
848 template <class R> struct evaluator4
850 template<class L, class F, class A>
851 static R eval(L & l, F f, A & a)
853 return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
857 template <> struct evaluator4<void>
859 template<class L, class F, class A>
860 static void eval(L & l, F f, A & a)
862 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
866 template <class R> struct evaluator5
868 template<class L, class F, class A>
869 static R eval(L & l, F f, A & a)
871 return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
875 template <> struct evaluator5<void>
877 template<class L, class F, class A>
878 static void eval(L & l, F f, A & a)
880 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
884 template <class R> struct evaluator6
886 template<class L, class F, class A>
887 static R eval(L & l, F f, A & a)
889 return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
893 template <> struct evaluator6<void>
895 template<class L, class F, class A>
896 static void eval(L & l, F f, A & a)
898 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
902 template <class R> struct evaluator7
904 template<class L, class F, class A>
905 static R eval(L & l, F f, A & a)
907 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_]);
911 template <> struct evaluator7<void>
913 template<class L, class F, class A>
914 static void eval(L & l, F f, A & a)
916 unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
920 template <class R> struct evaluator8
922 template<class L, class F, class A>
923 static R eval(L & l, F f, A & a)
925 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_]);
929 template <> struct evaluator8<void>
931 template<class L, class F, class A>
932 static void eval(L & l, F f, A & a)
934 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_]);
938 template <class R> struct evaluator9
940 template<class L, class F, class A>
941 static R eval(L & l, F f, A & a)
943 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_]);
947 template <> struct evaluator9<void>
949 template<class L, class F, class A>
950 static void eval(L & l, F f, A & a)
952 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_]);
960 #ifndef BOOST_NO_VOID_RETURNS
962 template<class R, class F, class L> class bind_t
966 bind_t(F f, L const & l): f_(f), l_(l) {}
968 #define BOOST_BIND_EVALUATE return l_(type<result_type>(), f_, a)
969 #include <boost/bind/bind_template.hpp>
970 #undef BOOST_BIND_EVALUATE
976 template<class R> struct bind_t_generator
979 template<class F, class L> class implementation
983 implementation(F f, L const & l): f_(f), l_(l) {}
985 #define BOOST_BIND_EVALUATE return L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
986 #include <boost/bind/bind_template.hpp>
987 #undef BOOST_BIND_EVALUATE
993 template<> struct bind_t_generator<void>
996 template<class F, class L> class implementation
1004 implementation(F f, L const & l): f_(f), l_(l) {}
1006 #define BOOST_BIND_EVALUATE L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
1007 #include <boost/bind/bind_template.hpp>
1008 #undef BOOST_BIND_EVALUATE
1014 template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
1018 bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
1026 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
1028 template<class T> struct add_value
1030 typedef value<T> type;
1033 template<class T> struct add_value< value<T> >
1035 typedef value<T> type;
1038 template<class T> struct add_value< reference_wrapper<T> >
1040 typedef reference_wrapper<T> type;
1043 template<int I> struct add_value< arg<I> >
1045 typedef boost::arg<I> type;
1048 template<int I> struct add_value< arg<I> (*) () >
1050 typedef boost::arg<I> (*type) ();
1053 template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
1055 typedef bind_t<R, F, L> type;
1060 template<int I> struct _avt_0;
1062 template<> struct _avt_0<1>
1064 template<class T> struct inner
1070 template<> struct _avt_0<2>
1072 template<class T> struct inner
1074 typedef value<T> type;
1078 typedef char (&_avt_r1) [1];
1079 typedef char (&_avt_r2) [2];
1081 template<class T> _avt_r1 _avt_f(value<T>);
1082 template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
1083 template<int I> _avt_r1 _avt_f(arg<I>);
1084 template<int I> _avt_r1 _avt_f(arg<I> (*) ());
1085 template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
1087 _avt_r2 _avt_f(...);
1089 template<class T> struct add_value
1092 typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
1099 template<class A1> struct list_av_1
1101 typedef typename add_value<A1>::type B1;
1102 typedef list1<B1> type;
1105 template<class A1, class A2> struct list_av_2
1107 typedef typename add_value<A1>::type B1;
1108 typedef typename add_value<A2>::type B2;
1109 typedef list2<B1, B2> type;
1112 template<class A1, class A2, class A3> struct list_av_3
1114 typedef typename add_value<A1>::type B1;
1115 typedef typename add_value<A2>::type B2;
1116 typedef typename add_value<A3>::type B3;
1117 typedef list3<B1, B2, B3> type;
1120 template<class A1, class A2, class A3, class A4> struct list_av_4
1122 typedef typename add_value<A1>::type B1;
1123 typedef typename add_value<A2>::type B2;
1124 typedef typename add_value<A3>::type B3;
1125 typedef typename add_value<A4>::type B4;
1126 typedef list4<B1, B2, B3, B4> type;
1129 template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
1131 typedef typename add_value<A1>::type B1;
1132 typedef typename add_value<A2>::type B2;
1133 typedef typename add_value<A3>::type B3;
1134 typedef typename add_value<A4>::type B4;
1135 typedef typename add_value<A5>::type B5;
1136 typedef list5<B1, B2, B3, B4, B5> type;
1139 template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
1141 typedef typename add_value<A1>::type B1;
1142 typedef typename add_value<A2>::type B2;
1143 typedef typename add_value<A3>::type B3;
1144 typedef typename add_value<A4>::type B4;
1145 typedef typename add_value<A5>::type B5;
1146 typedef typename add_value<A6>::type B6;
1147 typedef list6<B1, B2, B3, B4, B5, B6> type;
1150 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
1152 typedef typename add_value<A1>::type B1;
1153 typedef typename add_value<A2>::type B2;
1154 typedef typename add_value<A3>::type B3;
1155 typedef typename add_value<A4>::type B4;
1156 typedef typename add_value<A5>::type B5;
1157 typedef typename add_value<A6>::type B6;
1158 typedef typename add_value<A7>::type B7;
1159 typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
1162 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
1164 typedef typename add_value<A1>::type B1;
1165 typedef typename add_value<A2>::type B2;
1166 typedef typename add_value<A3>::type B3;
1167 typedef typename add_value<A4>::type B4;
1168 typedef typename add_value<A5>::type B5;
1169 typedef typename add_value<A6>::type B6;
1170 typedef typename add_value<A7>::type B7;
1171 typedef typename add_value<A8>::type B8;
1172 typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
1175 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
1177 typedef typename add_value<A1>::type B1;
1178 typedef typename add_value<A2>::type B2;
1179 typedef typename add_value<A3>::type B3;
1180 typedef typename add_value<A4>::type B4;
1181 typedef typename add_value<A5>::type B5;
1182 typedef typename add_value<A6>::type B6;
1183 typedef typename add_value<A7>::type B7;
1184 typedef typename add_value<A8>::type B8;
1185 typedef typename add_value<A9>::type B9;
1186 typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
1189 // g++ 2.95 specific helper; used by the data member overload
1191 template<class T> struct add_cref
1193 typedef T const & type;
1196 template<> struct add_cref<void>
1205 template<class V, class T> void visit_each(V & v, _bi::value<T> const & t, int)
1207 BOOST_BIND_VISIT_EACH(v, t.get(), 0);
1210 template<class V, class R, class F, class L> void visit_each(V & v, _bi::bind_t<R, F, L> const & t, int)
1218 #define BOOST_BIND bind
1221 // generic function objects
1223 template<class R, class F>
1224 _bi::bind_t<R, F, _bi::list0>
1227 typedef _bi::list0 list_type;
1228 return _bi::bind_t<R, F, list_type> (f, list_type());
1231 template<class R, class F, class A1>
1232 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1233 BOOST_BIND(F f, A1 a1)
1235 typedef typename _bi::list_av_1<A1>::type list_type;
1236 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1239 template<class R, class F, class A1, class A2>
1240 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1241 BOOST_BIND(F f, A1 a1, A2 a2)
1243 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1244 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1247 template<class R, class F, class A1, class A2, class A3>
1248 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1249 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1251 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1252 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1255 template<class R, class F, class A1, class A2, class A3, class A4>
1256 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1257 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1259 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1260 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1263 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1264 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1265 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1267 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1268 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1271 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1272 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1273 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1275 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1276 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1279 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1280 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1281 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1283 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1284 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1287 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1288 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1289 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1291 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1292 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1295 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1296 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1297 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1299 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1300 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1303 // generic function objects, alternative syntax
1305 template<class R, class F>
1306 _bi::bind_t<R, F, _bi::list0>
1307 BOOST_BIND(boost::type<R>, F f)
1309 typedef _bi::list0 list_type;
1310 return _bi::bind_t<R, F, list_type> (f, list_type());
1313 template<class R, class F, class A1>
1314 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1315 BOOST_BIND(boost::type<R>, F f, A1 a1)
1317 typedef typename _bi::list_av_1<A1>::type list_type;
1318 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1321 template<class R, class F, class A1, class A2>
1322 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1323 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
1325 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1326 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1329 template<class R, class F, class A1, class A2, class A3>
1330 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1331 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
1333 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1334 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1337 template<class R, class F, class A1, class A2, class A3, class A4>
1338 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1339 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
1341 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1342 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1345 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1346 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1347 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1349 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1350 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1353 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1354 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1355 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1357 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1358 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1361 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1362 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1363 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1365 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1366 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1369 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1370 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1371 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1373 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1374 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1377 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1378 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1379 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)
1381 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1382 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1385 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1387 // adaptable function objects
1390 _bi::bind_t<_bi::unspecified, F, _bi::list0>
1393 typedef _bi::list0 list_type;
1394 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
1397 template<class F, class A1>
1398 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
1399 BOOST_BIND(F f, A1 a1)
1401 typedef typename _bi::list_av_1<A1>::type list_type;
1402 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
1405 template<class F, class A1, class A2>
1406 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
1407 BOOST_BIND(F f, A1 a1, A2 a2)
1409 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1410 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
1413 template<class F, class A1, class A2, class A3>
1414 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
1415 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1417 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1418 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
1421 template<class F, class A1, class A2, class A3, class A4>
1422 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1423 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1425 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1426 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
1429 template<class F, class A1, class A2, class A3, class A4, class A5>
1430 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1431 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1433 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1434 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1437 template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
1438 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1439 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1441 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1442 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1445 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1446 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1447 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1449 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1450 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1453 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1454 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1455 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1457 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1458 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1461 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1462 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1463 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1465 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1466 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1469 #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1471 // function pointers
1473 #define BOOST_BIND_CC
1474 #define BOOST_BIND_ST
1476 #include <boost/bind/bind_cc.hpp>
1478 #undef BOOST_BIND_CC
1479 #undef BOOST_BIND_ST
1481 #ifdef BOOST_BIND_ENABLE_STDCALL
1483 #define BOOST_BIND_CC __stdcall
1484 #define BOOST_BIND_ST
1486 #include <boost/bind/bind_cc.hpp>
1488 #undef BOOST_BIND_CC
1489 #undef BOOST_BIND_ST
1493 #ifdef BOOST_BIND_ENABLE_FASTCALL
1495 #define BOOST_BIND_CC __fastcall
1496 #define BOOST_BIND_ST
1498 #include <boost/bind/bind_cc.hpp>
1500 #undef BOOST_BIND_CC
1501 #undef BOOST_BIND_ST
1505 #ifdef BOOST_BIND_ENABLE_PASCAL
1507 #define BOOST_BIND_ST pascal
1508 #define BOOST_BIND_CC
1510 #include <boost/bind/bind_cc.hpp>
1512 #undef BOOST_BIND_ST
1513 #undef BOOST_BIND_CC
1517 // member function pointers
1519 #define BOOST_BIND_MF_NAME(X) X
1520 #define BOOST_BIND_MF_CC
1522 #include <boost/bind/bind_mf_cc.hpp>
1524 #undef BOOST_BIND_MF_NAME
1525 #undef BOOST_BIND_MF_CC
1527 #ifdef BOOST_MEM_FN_ENABLE_STDCALL
1529 #define BOOST_BIND_MF_NAME(X) X##_stdcall
1530 #define BOOST_BIND_MF_CC __stdcall
1532 #include <boost/bind/bind_mf_cc.hpp>
1534 #undef BOOST_BIND_MF_NAME
1535 #undef BOOST_BIND_MF_CC
1539 #ifdef BOOST_MEM_FN_ENABLE_FASTCALL
1541 #define BOOST_BIND_MF_NAME(X) X##_fastcall
1542 #define BOOST_BIND_MF_CC __fastcall
1544 #include <boost/bind/bind_mf_cc.hpp>
1546 #undef BOOST_BIND_MF_NAME
1547 #undef BOOST_BIND_MF_CC
1551 // data member pointers
1553 #if defined(__GNUC__) && (__GNUC__ == 2)
1555 template<class R, class T, class A1>
1556 _bi::bind_t< typename _bi::add_cref<R>::type, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1557 BOOST_BIND(R T::*f, A1 a1)
1559 typedef _mfi::dm<R, T> F;
1560 typedef typename _bi::list_av_1<A1>::type list_type;
1561 return _bi::bind_t<typename _bi::add_cref<R>::type, F, list_type>(F(f), list_type(a1));
1566 template<class R, class T, class A1>
1567 _bi::bind_t< R const &, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1568 BOOST_BIND(R T::*f, A1 a1)
1570 typedef _mfi::dm<R, T> F;
1571 typedef typename _bi::list_av_1<A1>::type list_type;
1572 return _bi::bind_t<R const &, F, list_type>(F(f), list_type(a1));
1577 } // namespace boost
1579 #ifndef BOOST_BIND_NO_PLACEHOLDERS
1581 # include <boost/bind/placeholders.hpp>
1586 # pragma warning(default: 4512) // assignment operator could not be generated
1587 # pragma warning(pop)
1590 #endif // #ifndef BOOST_BIND_HPP_INCLUDED