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-2004 Peter Dimov and Multi Media Ltd.
14 // Copyright (c) 2001 David Abrahams
16 // Distributed under the Boost Software License, Version 1.0. (See
17 // accompanying file LICENSE_1_0.txt or copy at
18 // http://www.boost.org/LICENSE_1_0.txt)
20 // See http://www.boost.org/libs/bind/bind.html for documentation.
23 #include <boost/config.hpp>
24 #include <boost/ref.hpp>
25 #include <boost/mem_fn.hpp>
26 #include <boost/type.hpp>
27 #include <boost/bind/arg.hpp>
28 #include <boost/detail/workaround.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;
74 template<class T> bool ref_compare(T const & a, T const & b, long)
79 template<class T> bool ref_compare(reference_wrapper<T> const & a, reference_wrapper<T> const & b, int)
81 return a.get_pointer() == b.get_pointer();
84 // bind_t forward declaration for listN
86 template<class R, class F, class L> class bind_t;
90 template<class T> class value
94 value(T const & t): t_(t) {}
96 T & get() { return t_; }
97 T const & get() const { return t_; }
99 bool operator==(value const & rhs) const
111 template<class T> class type {};
115 template<class F> inline F & unwrap(F * f, long)
120 template<class F> inline F & unwrap(reference_wrapper<F> * f, int)
125 template<class F> inline F & unwrap(reference_wrapper<F> const * f, int)
130 #if !( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, <= 0x3003) )
132 template<class R, class T> inline _mfi::dm<R, T> unwrap(R T::* * pm, int)
134 return _mfi::dm<R, T>(*pm);
137 #if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
138 // IBM/VisualAge 6.0 is not able to handle this overload.
139 template<class R, class T> inline _mfi::dm<R, T> unwrap(R T::* const * pm, int)
141 return _mfi::dm<R, T>(*pm);
156 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
158 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
160 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
162 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); }
164 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); }
166 template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
168 return unwrap(&f, 0)();
171 template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
173 return unwrap(&f, 0)();
176 template<class F, class A> void operator()(type<void>, F & f, A &, int)
181 template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
186 template<class V> void accept(V &) const
190 bool operator==(list0 const &) const
196 template<class A1> class list1
200 explicit list1(A1 a1): a1_(a1) {}
202 A1 operator[] (boost::arg<1>) const { return a1_; }
204 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
206 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
208 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
210 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
212 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); }
214 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); }
216 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
218 return unwrap(&f, 0)(a[a1_]);
221 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
223 return unwrap(&f, 0)(a[a1_]);
226 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
228 unwrap(&f, 0)(a[a1_]);
231 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
233 unwrap(&f, 0)(a[a1_]);
236 template<class V> void accept(V & v) const
238 BOOST_BIND_VISIT_EACH(v, a1_, 0);
241 bool operator==(list1 const & rhs) const
243 return ref_compare(a1_, rhs.a1_, 0);
251 template<class A1, class A2> class list2
255 list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {}
257 A1 operator[] (boost::arg<1>) const { return a1_; }
258 A2 operator[] (boost::arg<2>) const { return a2_; }
260 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
261 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
263 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
265 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
267 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
269 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); }
271 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); }
273 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
275 return unwrap(&f, 0)(a[a1_], a[a2_]);
278 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
280 return unwrap(&f, 0)(a[a1_], a[a2_]);
283 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
285 unwrap(&f, 0)(a[a1_], a[a2_]);
288 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
290 unwrap(&f, 0)(a[a1_], a[a2_]);
293 template<class V> void accept(V & v) const
295 BOOST_BIND_VISIT_EACH(v, a1_, 0);
296 BOOST_BIND_VISIT_EACH(v, a2_, 0);
299 bool operator==(list2 const & rhs) const
301 return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0);
310 template<class A1, class A2, class A3> class list3
314 list3(A1 a1, A2 a2, A3 a3): a1_(a1), a2_(a2), a3_(a3) {}
316 A1 operator[] (boost::arg<1>) const { return a1_; }
317 A2 operator[] (boost::arg<2>) const { return a2_; }
318 A3 operator[] (boost::arg<3>) const { return a3_; }
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_; }
324 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
326 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
328 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
330 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); }
332 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); }
334 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
336 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
339 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
341 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
344 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
346 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
349 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
351 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
354 template<class V> void accept(V & v) const
356 BOOST_BIND_VISIT_EACH(v, a1_, 0);
357 BOOST_BIND_VISIT_EACH(v, a2_, 0);
358 BOOST_BIND_VISIT_EACH(v, a3_, 0);
361 bool operator==(list3 const & rhs) const
363 return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0);
373 template<class A1, class A2, class A3, class A4> class list4
377 list4(A1 a1, A2 a2, A3 a3, A4 a4): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {}
379 A1 operator[] (boost::arg<1>) const { return a1_; }
380 A2 operator[] (boost::arg<2>) const { return a2_; }
381 A3 operator[] (boost::arg<3>) const { return a3_; }
382 A4 operator[] (boost::arg<4>) const { return a4_; }
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_; }
389 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
391 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
393 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
395 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); }
397 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); }
399 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
401 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
404 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
406 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
409 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
411 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
414 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
416 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
419 template<class V> void accept(V & v) const
421 BOOST_BIND_VISIT_EACH(v, a1_, 0);
422 BOOST_BIND_VISIT_EACH(v, a2_, 0);
423 BOOST_BIND_VISIT_EACH(v, a3_, 0);
424 BOOST_BIND_VISIT_EACH(v, a4_, 0);
427 bool operator==(list4 const & rhs) const
430 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
431 ref_compare(a4_, rhs.a4_, 0);
442 template<class A1, class A2, class A3, class A4, class A5> class list5
446 list5(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {}
448 A1 operator[] (boost::arg<1>) const { return a1_; }
449 A2 operator[] (boost::arg<2>) const { return a2_; }
450 A3 operator[] (boost::arg<3>) const { return a3_; }
451 A4 operator[] (boost::arg<4>) const { return a4_; }
452 A5 operator[] (boost::arg<5>) const { return a5_; }
454 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
455 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
456 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
457 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
458 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
460 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
462 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
464 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
466 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); }
468 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); }
470 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
472 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
475 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
477 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
480 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
482 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
485 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
487 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
490 template<class V> void accept(V & v) const
492 BOOST_BIND_VISIT_EACH(v, a1_, 0);
493 BOOST_BIND_VISIT_EACH(v, a2_, 0);
494 BOOST_BIND_VISIT_EACH(v, a3_, 0);
495 BOOST_BIND_VISIT_EACH(v, a4_, 0);
496 BOOST_BIND_VISIT_EACH(v, a5_, 0);
499 bool operator==(list5 const & rhs) const
502 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
503 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0);
515 template<class A1, class A2, class A3, class A4, class A5, class A6> class list6
519 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) {}
521 A1 operator[] (boost::arg<1>) const { return a1_; }
522 A2 operator[] (boost::arg<2>) const { return a2_; }
523 A3 operator[] (boost::arg<3>) const { return a3_; }
524 A4 operator[] (boost::arg<4>) const { return a4_; }
525 A5 operator[] (boost::arg<5>) const { return a5_; }
526 A6 operator[] (boost::arg<6>) const { return a6_; }
528 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
529 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
530 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
531 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
532 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
533 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
535 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
537 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
539 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
541 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); }
543 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); }
545 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
547 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
550 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
552 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
555 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
557 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
560 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
562 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
565 template<class V> void accept(V & v) const
567 BOOST_BIND_VISIT_EACH(v, a1_, 0);
568 BOOST_BIND_VISIT_EACH(v, a2_, 0);
569 BOOST_BIND_VISIT_EACH(v, a3_, 0);
570 BOOST_BIND_VISIT_EACH(v, a4_, 0);
571 BOOST_BIND_VISIT_EACH(v, a5_, 0);
572 BOOST_BIND_VISIT_EACH(v, a6_, 0);
575 bool operator==(list6 const & rhs) const
578 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
579 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0);
592 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7
596 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) {}
598 A1 operator[] (boost::arg<1>) const { return a1_; }
599 A2 operator[] (boost::arg<2>) const { return a2_; }
600 A3 operator[] (boost::arg<3>) const { return a3_; }
601 A4 operator[] (boost::arg<4>) const { return a4_; }
602 A5 operator[] (boost::arg<5>) const { return a5_; }
603 A6 operator[] (boost::arg<6>) const { return a6_; }
604 A7 operator[] (boost::arg<7>) const { return a7_; }
606 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
607 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
608 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
609 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
610 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
611 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
612 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
614 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
616 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
618 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
620 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); }
622 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); }
624 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
626 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
629 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
631 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
634 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
636 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
639 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
641 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
644 template<class V> void accept(V & v) const
646 BOOST_BIND_VISIT_EACH(v, a1_, 0);
647 BOOST_BIND_VISIT_EACH(v, a2_, 0);
648 BOOST_BIND_VISIT_EACH(v, a3_, 0);
649 BOOST_BIND_VISIT_EACH(v, a4_, 0);
650 BOOST_BIND_VISIT_EACH(v, a5_, 0);
651 BOOST_BIND_VISIT_EACH(v, a6_, 0);
652 BOOST_BIND_VISIT_EACH(v, a7_, 0);
655 bool operator==(list7 const & rhs) const
658 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
659 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
660 ref_compare(a7_, rhs.a7_, 0);
674 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class list8
678 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) {}
680 A1 operator[] (boost::arg<1>) const { return a1_; }
681 A2 operator[] (boost::arg<2>) const { return a2_; }
682 A3 operator[] (boost::arg<3>) const { return a3_; }
683 A4 operator[] (boost::arg<4>) const { return a4_; }
684 A5 operator[] (boost::arg<5>) const { return a5_; }
685 A6 operator[] (boost::arg<6>) const { return a6_; }
686 A7 operator[] (boost::arg<7>) const { return a7_; }
687 A8 operator[] (boost::arg<8>) const { return a8_; }
689 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
690 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
691 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
692 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
693 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
694 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
695 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
696 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
698 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
700 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
702 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
704 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); }
706 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); }
708 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
710 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
713 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
715 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
718 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
720 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
723 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
725 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
728 template<class V> void accept(V & v) const
730 BOOST_BIND_VISIT_EACH(v, a1_, 0);
731 BOOST_BIND_VISIT_EACH(v, a2_, 0);
732 BOOST_BIND_VISIT_EACH(v, a3_, 0);
733 BOOST_BIND_VISIT_EACH(v, a4_, 0);
734 BOOST_BIND_VISIT_EACH(v, a5_, 0);
735 BOOST_BIND_VISIT_EACH(v, a6_, 0);
736 BOOST_BIND_VISIT_EACH(v, a7_, 0);
737 BOOST_BIND_VISIT_EACH(v, a8_, 0);
740 bool operator==(list8 const & rhs) const
743 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
744 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
745 ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0);
760 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9
764 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) {}
766 A1 operator[] (boost::arg<1>) const { return a1_; }
767 A2 operator[] (boost::arg<2>) const { return a2_; }
768 A3 operator[] (boost::arg<3>) const { return a3_; }
769 A4 operator[] (boost::arg<4>) const { return a4_; }
770 A5 operator[] (boost::arg<5>) const { return a5_; }
771 A6 operator[] (boost::arg<6>) const { return a6_; }
772 A7 operator[] (boost::arg<7>) const { return a7_; }
773 A8 operator[] (boost::arg<8>) const { return a8_; }
774 A9 operator[] (boost::arg<9>) const { return a9_; }
776 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
777 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
778 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
779 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
780 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
781 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
782 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
783 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
784 A9 operator[] (boost::arg<9> (*) ()) const { return a9_; }
786 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
788 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
790 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
792 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); }
794 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); }
796 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
798 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
801 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
803 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
806 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
808 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
811 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
813 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
816 template<class V> void accept(V & v) const
818 BOOST_BIND_VISIT_EACH(v, a1_, 0);
819 BOOST_BIND_VISIT_EACH(v, a2_, 0);
820 BOOST_BIND_VISIT_EACH(v, a3_, 0);
821 BOOST_BIND_VISIT_EACH(v, a4_, 0);
822 BOOST_BIND_VISIT_EACH(v, a5_, 0);
823 BOOST_BIND_VISIT_EACH(v, a6_, 0);
824 BOOST_BIND_VISIT_EACH(v, a7_, 0);
825 BOOST_BIND_VISIT_EACH(v, a8_, 0);
826 BOOST_BIND_VISIT_EACH(v, a9_, 0);
829 bool operator==(list9 const & rhs) const
832 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
833 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
834 ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0) && ref_compare(a9_, rhs.a9_, 0);
852 #ifndef BOOST_NO_VOID_RETURNS
854 template<class R, class F, class L> class bind_t
858 typedef bind_t this_type;
860 bind_t(F f, L const & l): f_(f), l_(l) {}
862 #define BOOST_BIND_RETURN return
863 #include <boost/bind/bind_template.hpp>
864 #undef BOOST_BIND_RETURN
870 template<class R> struct bind_t_generator
873 template<class F, class L> class implementation
877 typedef implementation this_type;
879 implementation(F f, L const & l): f_(f), l_(l) {}
881 #define BOOST_BIND_RETURN return
882 #include <boost/bind/bind_template.hpp>
883 #undef BOOST_BIND_RETURN
889 template<> struct bind_t_generator<void>
892 template<class F, class L> class implementation
900 typedef implementation this_type;
902 implementation(F f, L const & l): f_(f), l_(l) {}
904 #define BOOST_BIND_RETURN
905 #include <boost/bind/bind_template.hpp>
906 #undef BOOST_BIND_RETURN
912 template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
916 bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
922 // bind_t::operator==
924 template<class R, class F, class L> bool operator==(bind_t<R, F, L> const & a, bind_t<R, F, L> const & b)
929 template<class R, class F, class L> bool operator!=(bind_t<R, F, L> const & a, bind_t<R, F, L> const & b)
931 return !a.compare(b);
936 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
938 template<class T> struct add_value
940 typedef value<T> type;
943 template<class T> struct add_value< value<T> >
945 typedef value<T> type;
948 template<class T> struct add_value< reference_wrapper<T> >
950 typedef reference_wrapper<T> type;
953 template<int I> struct add_value< arg<I> >
955 typedef boost::arg<I> type;
958 template<int I> struct add_value< arg<I> (*) () >
960 typedef boost::arg<I> (*type) ();
963 template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
965 typedef bind_t<R, F, L> type;
970 template<int I> struct _avt_0;
972 template<> struct _avt_0<1>
974 template<class T> struct inner
980 template<> struct _avt_0<2>
982 template<class T> struct inner
984 typedef value<T> type;
988 typedef char (&_avt_r1) [1];
989 typedef char (&_avt_r2) [2];
991 template<class T> _avt_r1 _avt_f(value<T>);
992 template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
993 template<int I> _avt_r1 _avt_f(arg<I>);
994 template<int I> _avt_r1 _avt_f(arg<I> (*) ());
995 template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
999 template<class T> struct add_value
1002 typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
1009 template<class A1> struct list_av_1
1011 typedef typename add_value<A1>::type B1;
1012 typedef list1<B1> type;
1015 template<class A1, class A2> struct list_av_2
1017 typedef typename add_value<A1>::type B1;
1018 typedef typename add_value<A2>::type B2;
1019 typedef list2<B1, B2> type;
1022 template<class A1, class A2, class A3> struct list_av_3
1024 typedef typename add_value<A1>::type B1;
1025 typedef typename add_value<A2>::type B2;
1026 typedef typename add_value<A3>::type B3;
1027 typedef list3<B1, B2, B3> type;
1030 template<class A1, class A2, class A3, class A4> struct list_av_4
1032 typedef typename add_value<A1>::type B1;
1033 typedef typename add_value<A2>::type B2;
1034 typedef typename add_value<A3>::type B3;
1035 typedef typename add_value<A4>::type B4;
1036 typedef list4<B1, B2, B3, B4> type;
1039 template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
1041 typedef typename add_value<A1>::type B1;
1042 typedef typename add_value<A2>::type B2;
1043 typedef typename add_value<A3>::type B3;
1044 typedef typename add_value<A4>::type B4;
1045 typedef typename add_value<A5>::type B5;
1046 typedef list5<B1, B2, B3, B4, B5> type;
1049 template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
1051 typedef typename add_value<A1>::type B1;
1052 typedef typename add_value<A2>::type B2;
1053 typedef typename add_value<A3>::type B3;
1054 typedef typename add_value<A4>::type B4;
1055 typedef typename add_value<A5>::type B5;
1056 typedef typename add_value<A6>::type B6;
1057 typedef list6<B1, B2, B3, B4, B5, B6> type;
1060 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
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 typename add_value<A4>::type B4;
1066 typedef typename add_value<A5>::type B5;
1067 typedef typename add_value<A6>::type B6;
1068 typedef typename add_value<A7>::type B7;
1069 typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
1072 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
1074 typedef typename add_value<A1>::type B1;
1075 typedef typename add_value<A2>::type B2;
1076 typedef typename add_value<A3>::type B3;
1077 typedef typename add_value<A4>::type B4;
1078 typedef typename add_value<A5>::type B5;
1079 typedef typename add_value<A6>::type B6;
1080 typedef typename add_value<A7>::type B7;
1081 typedef typename add_value<A8>::type B8;
1082 typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
1085 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
1087 typedef typename add_value<A1>::type B1;
1088 typedef typename add_value<A2>::type B2;
1089 typedef typename add_value<A3>::type B3;
1090 typedef typename add_value<A4>::type B4;
1091 typedef typename add_value<A5>::type B5;
1092 typedef typename add_value<A6>::type B6;
1093 typedef typename add_value<A7>::type B7;
1094 typedef typename add_value<A8>::type B8;
1095 typedef typename add_value<A9>::type B9;
1096 typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
1103 template<class V, class T> void visit_each(V & v, _bi::value<T> const & t, int)
1105 BOOST_BIND_VISIT_EACH(v, t.get(), 0);
1108 template<class V, class R, class F, class L> void visit_each(V & v, _bi::bind_t<R, F, L> const & t, int)
1116 #define BOOST_BIND bind
1119 // generic function objects
1121 template<class R, class F>
1122 _bi::bind_t<R, F, _bi::list0>
1125 typedef _bi::list0 list_type;
1126 return _bi::bind_t<R, F, list_type> (f, list_type());
1129 template<class R, class F, class A1>
1130 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1131 BOOST_BIND(F f, A1 a1)
1133 typedef typename _bi::list_av_1<A1>::type list_type;
1134 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1137 template<class R, class F, class A1, class A2>
1138 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1139 BOOST_BIND(F f, A1 a1, A2 a2)
1141 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1142 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1145 template<class R, class F, class A1, class A2, class A3>
1146 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1147 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1149 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1150 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1153 template<class R, class F, class A1, class A2, class A3, class A4>
1154 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1155 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1157 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1158 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1161 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1162 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1163 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1165 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1166 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1169 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1170 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1171 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1173 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1174 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1177 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1178 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1179 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1181 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1182 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1185 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1186 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1187 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1189 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1190 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1193 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1194 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1195 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1197 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1198 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1201 // generic function objects, alternative syntax
1203 template<class R, class F>
1204 _bi::bind_t<R, F, _bi::list0>
1205 BOOST_BIND(boost::type<R>, F f)
1207 typedef _bi::list0 list_type;
1208 return _bi::bind_t<R, F, list_type> (f, list_type());
1211 template<class R, class F, class A1>
1212 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1213 BOOST_BIND(boost::type<R>, F f, A1 a1)
1215 typedef typename _bi::list_av_1<A1>::type list_type;
1216 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1219 template<class R, class F, class A1, class A2>
1220 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1221 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
1223 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1224 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1227 template<class R, class F, class A1, class A2, class A3>
1228 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1229 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
1231 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1232 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1235 template<class R, class F, class A1, class A2, class A3, class A4>
1236 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1237 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
1239 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1240 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1243 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1244 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1245 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1247 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1248 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1251 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1252 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1253 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1255 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1256 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1259 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1260 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1261 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1263 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1264 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1267 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1268 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1269 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1271 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1272 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1275 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1276 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1277 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)
1279 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1280 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1283 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1285 // adaptable function objects
1288 _bi::bind_t<_bi::unspecified, F, _bi::list0>
1291 typedef _bi::list0 list_type;
1292 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
1295 template<class F, class A1>
1296 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
1297 BOOST_BIND(F f, A1 a1)
1299 typedef typename _bi::list_av_1<A1>::type list_type;
1300 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
1303 template<class F, class A1, class A2>
1304 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
1305 BOOST_BIND(F f, A1 a1, A2 a2)
1307 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1308 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
1311 template<class F, class A1, class A2, class A3>
1312 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
1313 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1315 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1316 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
1319 template<class F, class A1, class A2, class A3, class A4>
1320 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1321 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1323 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1324 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
1327 template<class F, class A1, class A2, class A3, class A4, class A5>
1328 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1329 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1331 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1332 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1335 template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
1336 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1337 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1339 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1340 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1343 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1344 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1345 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1347 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1348 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1351 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1352 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1353 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1355 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1356 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1359 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1360 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1361 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1363 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1364 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1367 #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1369 // function pointers
1371 #define BOOST_BIND_CC
1372 #define BOOST_BIND_ST
1374 #include <boost/bind/bind_cc.hpp>
1376 #undef BOOST_BIND_CC
1377 #undef BOOST_BIND_ST
1379 #ifdef BOOST_BIND_ENABLE_STDCALL
1381 #define BOOST_BIND_CC __stdcall
1382 #define BOOST_BIND_ST
1384 #include <boost/bind/bind_cc.hpp>
1386 #undef BOOST_BIND_CC
1387 #undef BOOST_BIND_ST
1391 #ifdef BOOST_BIND_ENABLE_FASTCALL
1393 #define BOOST_BIND_CC __fastcall
1394 #define BOOST_BIND_ST
1396 #include <boost/bind/bind_cc.hpp>
1398 #undef BOOST_BIND_CC
1399 #undef BOOST_BIND_ST
1403 #ifdef BOOST_BIND_ENABLE_PASCAL
1405 #define BOOST_BIND_ST pascal
1406 #define BOOST_BIND_CC
1408 #include <boost/bind/bind_cc.hpp>
1410 #undef BOOST_BIND_ST
1411 #undef BOOST_BIND_CC
1415 // member function pointers
1417 #define BOOST_BIND_MF_NAME(X) X
1418 #define BOOST_BIND_MF_CC
1420 #include <boost/bind/bind_mf_cc.hpp>
1422 #undef BOOST_BIND_MF_NAME
1423 #undef BOOST_BIND_MF_CC
1425 #ifdef BOOST_MEM_FN_ENABLE_STDCALL
1427 #define BOOST_BIND_MF_NAME(X) X##_stdcall
1428 #define BOOST_BIND_MF_CC __stdcall
1430 #include <boost/bind/bind_mf_cc.hpp>
1432 #undef BOOST_BIND_MF_NAME
1433 #undef BOOST_BIND_MF_CC
1437 #ifdef BOOST_MEM_FN_ENABLE_FASTCALL
1439 #define BOOST_BIND_MF_NAME(X) X##_fastcall
1440 #define BOOST_BIND_MF_CC __fastcall
1442 #include <boost/bind/bind_mf_cc.hpp>
1444 #undef BOOST_BIND_MF_NAME
1445 #undef BOOST_BIND_MF_CC
1449 // data member pointers
1453 #if defined(__GNUC__) && (__GNUC__ == 2)
1458 template<class T> struct add_cref
1460 typedef T const & type;
1463 template<class T> struct add_cref< T & >
1465 typedef T const & type;
1468 template<> struct add_cref<void>
1475 template<class R, class T, class A1>
1476 _bi::bind_t< typename _bi::add_cref<R>::type, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1477 BOOST_BIND(R T::*f, A1 a1)
1479 typedef _mfi::dm<R, T> F;
1480 typedef typename _bi::list_av_1<A1>::type list_type;
1481 return _bi::bind_t<typename _bi::add_cref<R>::type, F, list_type>(F(f), list_type(a1));
1486 template<class R, class T, class A1>
1487 _bi::bind_t< R const &, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1488 BOOST_BIND(R T::*f, A1 a1)
1490 typedef _mfi::dm<R, T> F;
1491 typedef typename _bi::list_av_1<A1>::type list_type;
1492 return _bi::bind_t<R const &, F, list_type>(F(f), list_type(a1));
1499 template<class R, class T, class A1>
1500 _bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1501 BOOST_BIND(R T::*f, A1 a1)
1503 typedef _mfi::dm<R, T> F;
1504 typedef typename _bi::list_av_1<A1>::type list_type;
1505 return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
1508 } // namespace boost
1510 #ifndef BOOST_BIND_NO_PLACEHOLDERS
1512 # include <boost/bind/placeholders.hpp>
1517 # pragma warning(default: 4512) // assignment operator could not be generated
1518 # pragma warning(pop)
1521 #endif // #ifndef BOOST_BIND_HPP_INCLUDED