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/visit_each.hpp>
29 #include <boost/detail/workaround.hpp>
31 // Borland-specific bug, visit_each() silently fails to produce code
33 #if defined(__BORLANDC__)
34 # define BOOST_BIND_VISIT_EACH boost::visit_each
36 # define BOOST_BIND_VISIT_EACH visit_each
40 # pragma warning(push)
41 # pragma warning(disable: 4512) // assignment operator could not be generated
47 namespace _bi // implementation details
52 template<class R, class F> struct result_traits
57 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
59 struct unspecified {};
61 template<class F> struct result_traits<unspecified, F>
63 typedef typename F::result_type type;
66 template<class F> struct result_traits< unspecified, reference_wrapper<F> >
68 typedef typename F::result_type type;
75 template<class T> bool ref_compare(T const & a, T const & b, long)
80 template<class T> bool ref_compare(reference_wrapper<T> const & a, reference_wrapper<T> const & b, int)
82 return a.get_pointer() == b.get_pointer();
85 // bind_t forward declaration for listN
87 template<class R, class F, class L> class bind_t;
91 template<class T> class value
95 value(T const & t): t_(t) {}
97 T & get() { return t_; }
98 T const & get() const { return t_; }
100 bool operator==(value const & rhs) const
112 template<class T> class type {};
116 template<class F> inline F & unwrap(F * f, long)
121 template<class F> inline F & unwrap(reference_wrapper<F> * f, int)
126 template<class F> inline F & unwrap(reference_wrapper<F> const * f, int)
131 #if !( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, <= 0x3003) )
133 template<class R, class T> inline _mfi::dm<R, T> unwrap(R T::* * pm, int)
135 return _mfi::dm<R, T>(*pm);
138 #if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
139 // IBM/VisualAge 6.0 is not able to handle this overload.
140 template<class R, class T> inline _mfi::dm<R, T> unwrap(R T::* const * pm, int)
142 return _mfi::dm<R, T>(*pm);
157 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
159 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
161 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
163 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); }
165 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); }
167 template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
169 return unwrap(&f, 0)();
172 template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
174 return unwrap(&f, 0)();
177 template<class F, class A> void operator()(type<void>, F & f, A &, int)
182 template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
187 template<class V> void accept(V &) const
191 bool operator==(list0 const &) const
197 template<class A1> class list1
201 explicit list1(A1 a1): a1_(a1) {}
203 A1 operator[] (boost::arg<1>) const { return a1_; }
205 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
207 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
209 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
211 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
213 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); }
215 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); }
217 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
219 return unwrap(&f, 0)(a[a1_]);
222 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
224 return unwrap(&f, 0)(a[a1_]);
227 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
229 unwrap(&f, 0)(a[a1_]);
232 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
234 unwrap(&f, 0)(a[a1_]);
237 template<class V> void accept(V & v) const
239 BOOST_BIND_VISIT_EACH(v, a1_, 0);
242 bool operator==(list1 const & rhs) const
244 return ref_compare(a1_, rhs.a1_, 0);
252 template<class A1, class A2> class list2
256 list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {}
258 A1 operator[] (boost::arg<1>) const { return a1_; }
259 A2 operator[] (boost::arg<2>) const { return a2_; }
261 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
262 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
264 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
266 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
268 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
270 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); }
272 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); }
274 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
276 return unwrap(&f, 0)(a[a1_], a[a2_]);
279 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
281 return unwrap(&f, 0)(a[a1_], a[a2_]);
284 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
286 unwrap(&f, 0)(a[a1_], a[a2_]);
289 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
291 unwrap(&f, 0)(a[a1_], a[a2_]);
294 template<class V> void accept(V & v) const
296 BOOST_BIND_VISIT_EACH(v, a1_, 0);
297 BOOST_BIND_VISIT_EACH(v, a2_, 0);
300 bool operator==(list2 const & rhs) const
302 return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0);
311 template<class A1, class A2, class A3> class list3
315 list3(A1 a1, A2 a2, A3 a3): a1_(a1), a2_(a2), a3_(a3) {}
317 A1 operator[] (boost::arg<1>) const { return a1_; }
318 A2 operator[] (boost::arg<2>) const { return a2_; }
319 A3 operator[] (boost::arg<3>) const { return a3_; }
321 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
322 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
323 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
325 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
327 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
329 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
331 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); }
333 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); }
335 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
337 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
340 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
342 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
345 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
347 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
350 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
352 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
355 template<class V> void accept(V & v) const
357 BOOST_BIND_VISIT_EACH(v, a1_, 0);
358 BOOST_BIND_VISIT_EACH(v, a2_, 0);
359 BOOST_BIND_VISIT_EACH(v, a3_, 0);
362 bool operator==(list3 const & rhs) const
364 return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0);
374 template<class A1, class A2, class A3, class A4> class list4
378 list4(A1 a1, A2 a2, A3 a3, A4 a4): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {}
380 A1 operator[] (boost::arg<1>) const { return a1_; }
381 A2 operator[] (boost::arg<2>) const { return a2_; }
382 A3 operator[] (boost::arg<3>) const { return a3_; }
383 A4 operator[] (boost::arg<4>) const { return a4_; }
385 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
386 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
387 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
388 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
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, long)
402 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
405 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
407 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
410 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
412 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
415 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
417 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
420 template<class V> void accept(V & v) const
422 BOOST_BIND_VISIT_EACH(v, a1_, 0);
423 BOOST_BIND_VISIT_EACH(v, a2_, 0);
424 BOOST_BIND_VISIT_EACH(v, a3_, 0);
425 BOOST_BIND_VISIT_EACH(v, a4_, 0);
428 bool operator==(list4 const & rhs) const
431 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
432 ref_compare(a4_, rhs.a4_, 0);
443 template<class A1, class A2, class A3, class A4, class A5> class list5
447 list5(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {}
449 A1 operator[] (boost::arg<1>) const { return a1_; }
450 A2 operator[] (boost::arg<2>) const { return a2_; }
451 A3 operator[] (boost::arg<3>) const { return a3_; }
452 A4 operator[] (boost::arg<4>) const { return a4_; }
453 A5 operator[] (boost::arg<5>) const { return a5_; }
455 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
456 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
457 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
458 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
459 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
461 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
463 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
465 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
467 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); }
469 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); }
471 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
473 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
476 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
478 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
481 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
483 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
486 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
488 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
491 template<class V> void accept(V & v) const
493 BOOST_BIND_VISIT_EACH(v, a1_, 0);
494 BOOST_BIND_VISIT_EACH(v, a2_, 0);
495 BOOST_BIND_VISIT_EACH(v, a3_, 0);
496 BOOST_BIND_VISIT_EACH(v, a4_, 0);
497 BOOST_BIND_VISIT_EACH(v, a5_, 0);
500 bool operator==(list5 const & rhs) const
503 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
504 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0);
516 template<class A1, class A2, class A3, class A4, class A5, class A6> class list6
520 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) {}
522 A1 operator[] (boost::arg<1>) const { return a1_; }
523 A2 operator[] (boost::arg<2>) const { return a2_; }
524 A3 operator[] (boost::arg<3>) const { return a3_; }
525 A4 operator[] (boost::arg<4>) const { return a4_; }
526 A5 operator[] (boost::arg<5>) const { return a5_; }
527 A6 operator[] (boost::arg<6>) const { return a6_; }
529 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
530 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
531 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
532 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
533 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
534 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
536 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
538 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
540 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
542 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); }
544 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); }
546 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
548 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
551 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
553 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
556 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
558 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
561 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
563 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
566 template<class V> void accept(V & v) const
568 BOOST_BIND_VISIT_EACH(v, a1_, 0);
569 BOOST_BIND_VISIT_EACH(v, a2_, 0);
570 BOOST_BIND_VISIT_EACH(v, a3_, 0);
571 BOOST_BIND_VISIT_EACH(v, a4_, 0);
572 BOOST_BIND_VISIT_EACH(v, a5_, 0);
573 BOOST_BIND_VISIT_EACH(v, a6_, 0);
576 bool operator==(list6 const & rhs) const
579 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
580 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0);
593 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7
597 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) {}
599 A1 operator[] (boost::arg<1>) const { return a1_; }
600 A2 operator[] (boost::arg<2>) const { return a2_; }
601 A3 operator[] (boost::arg<3>) const { return a3_; }
602 A4 operator[] (boost::arg<4>) const { return a4_; }
603 A5 operator[] (boost::arg<5>) const { return a5_; }
604 A6 operator[] (boost::arg<6>) const { return a6_; }
605 A7 operator[] (boost::arg<7>) const { return a7_; }
607 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
608 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
609 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
610 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
611 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
612 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
613 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
615 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
617 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
619 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
621 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); }
623 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); }
625 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
627 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
630 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
632 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
635 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
637 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
640 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
642 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
645 template<class V> void accept(V & v) const
647 BOOST_BIND_VISIT_EACH(v, a1_, 0);
648 BOOST_BIND_VISIT_EACH(v, a2_, 0);
649 BOOST_BIND_VISIT_EACH(v, a3_, 0);
650 BOOST_BIND_VISIT_EACH(v, a4_, 0);
651 BOOST_BIND_VISIT_EACH(v, a5_, 0);
652 BOOST_BIND_VISIT_EACH(v, a6_, 0);
653 BOOST_BIND_VISIT_EACH(v, a7_, 0);
656 bool operator==(list7 const & rhs) const
659 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
660 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
661 ref_compare(a7_, rhs.a7_, 0);
675 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class list8
679 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) {}
681 A1 operator[] (boost::arg<1>) const { return a1_; }
682 A2 operator[] (boost::arg<2>) const { return a2_; }
683 A3 operator[] (boost::arg<3>) const { return a3_; }
684 A4 operator[] (boost::arg<4>) const { return a4_; }
685 A5 operator[] (boost::arg<5>) const { return a5_; }
686 A6 operator[] (boost::arg<6>) const { return a6_; }
687 A7 operator[] (boost::arg<7>) const { return a7_; }
688 A8 operator[] (boost::arg<8>) const { return a8_; }
690 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
691 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
692 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
693 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
694 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
695 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
696 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
697 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
699 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
701 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
703 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
705 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); }
707 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); }
709 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
711 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
714 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
716 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
719 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
721 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
724 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
726 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
729 template<class V> void accept(V & v) const
731 BOOST_BIND_VISIT_EACH(v, a1_, 0);
732 BOOST_BIND_VISIT_EACH(v, a2_, 0);
733 BOOST_BIND_VISIT_EACH(v, a3_, 0);
734 BOOST_BIND_VISIT_EACH(v, a4_, 0);
735 BOOST_BIND_VISIT_EACH(v, a5_, 0);
736 BOOST_BIND_VISIT_EACH(v, a6_, 0);
737 BOOST_BIND_VISIT_EACH(v, a7_, 0);
738 BOOST_BIND_VISIT_EACH(v, a8_, 0);
741 bool operator==(list8 const & rhs) const
744 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
745 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
746 ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0);
761 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9
765 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) {}
767 A1 operator[] (boost::arg<1>) const { return a1_; }
768 A2 operator[] (boost::arg<2>) const { return a2_; }
769 A3 operator[] (boost::arg<3>) const { return a3_; }
770 A4 operator[] (boost::arg<4>) const { return a4_; }
771 A5 operator[] (boost::arg<5>) const { return a5_; }
772 A6 operator[] (boost::arg<6>) const { return a6_; }
773 A7 operator[] (boost::arg<7>) const { return a7_; }
774 A8 operator[] (boost::arg<8>) const { return a8_; }
775 A9 operator[] (boost::arg<9>) const { return a9_; }
777 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
778 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
779 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
780 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
781 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
782 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
783 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
784 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
785 A9 operator[] (boost::arg<9> (*) ()) const { return a9_; }
787 template<class T> T & operator[] (value<T> & v) const { return v.get(); }
789 template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
791 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
793 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); }
795 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); }
797 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
799 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
802 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
804 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
807 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
809 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
812 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
814 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
817 template<class V> void accept(V & v) const
819 BOOST_BIND_VISIT_EACH(v, a1_, 0);
820 BOOST_BIND_VISIT_EACH(v, a2_, 0);
821 BOOST_BIND_VISIT_EACH(v, a3_, 0);
822 BOOST_BIND_VISIT_EACH(v, a4_, 0);
823 BOOST_BIND_VISIT_EACH(v, a5_, 0);
824 BOOST_BIND_VISIT_EACH(v, a6_, 0);
825 BOOST_BIND_VISIT_EACH(v, a7_, 0);
826 BOOST_BIND_VISIT_EACH(v, a8_, 0);
827 BOOST_BIND_VISIT_EACH(v, a9_, 0);
830 bool operator==(list9 const & rhs) const
833 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
834 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
835 ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0) && ref_compare(a9_, rhs.a9_, 0);
853 #ifndef BOOST_NO_VOID_RETURNS
855 template<class R, class F, class L> class bind_t
859 typedef bind_t this_type;
861 bind_t(F f, L const & l): f_(f), l_(l) {}
863 #define BOOST_BIND_RETURN return
864 #include <boost/bind/bind_template.hpp>
865 #undef BOOST_BIND_RETURN
871 template<class R> struct bind_t_generator
874 template<class F, class L> class implementation
878 typedef implementation this_type;
880 implementation(F f, L const & l): f_(f), l_(l) {}
882 #define BOOST_BIND_RETURN return
883 #include <boost/bind/bind_template.hpp>
884 #undef BOOST_BIND_RETURN
890 template<> struct bind_t_generator<void>
893 template<class F, class L> class implementation
901 typedef implementation this_type;
903 implementation(F f, L const & l): f_(f), l_(l) {}
905 #define BOOST_BIND_RETURN
906 #include <boost/bind/bind_template.hpp>
907 #undef BOOST_BIND_RETURN
913 template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
917 bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
923 // bind_t::operator==
925 template<class R, class F, class L> bool operator==(bind_t<R, F, L> const & a, bind_t<R, F, L> const & b)
930 template<class R, class F, class L> bool operator!=(bind_t<R, F, L> const & a, bind_t<R, F, L> const & b)
932 return !a.compare(b);
937 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
939 template<class T> struct add_value
941 typedef value<T> type;
944 template<class T> struct add_value< value<T> >
946 typedef value<T> type;
949 template<class T> struct add_value< reference_wrapper<T> >
951 typedef reference_wrapper<T> type;
954 template<int I> struct add_value< arg<I> >
956 typedef boost::arg<I> type;
959 template<int I> struct add_value< arg<I> (*) () >
961 typedef boost::arg<I> (*type) ();
964 template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
966 typedef bind_t<R, F, L> type;
971 template<int I> struct _avt_0;
973 template<> struct _avt_0<1>
975 template<class T> struct inner
981 template<> struct _avt_0<2>
983 template<class T> struct inner
985 typedef value<T> type;
989 typedef char (&_avt_r1) [1];
990 typedef char (&_avt_r2) [2];
992 template<class T> _avt_r1 _avt_f(value<T>);
993 template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
994 template<int I> _avt_r1 _avt_f(arg<I>);
995 template<int I> _avt_r1 _avt_f(arg<I> (*) ());
996 template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
1000 template<class T> struct add_value
1003 typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
1010 template<class A1> struct list_av_1
1012 typedef typename add_value<A1>::type B1;
1013 typedef list1<B1> type;
1016 template<class A1, class A2> struct list_av_2
1018 typedef typename add_value<A1>::type B1;
1019 typedef typename add_value<A2>::type B2;
1020 typedef list2<B1, B2> type;
1023 template<class A1, class A2, class A3> struct list_av_3
1025 typedef typename add_value<A1>::type B1;
1026 typedef typename add_value<A2>::type B2;
1027 typedef typename add_value<A3>::type B3;
1028 typedef list3<B1, B2, B3> type;
1031 template<class A1, class A2, class A3, class A4> struct list_av_4
1033 typedef typename add_value<A1>::type B1;
1034 typedef typename add_value<A2>::type B2;
1035 typedef typename add_value<A3>::type B3;
1036 typedef typename add_value<A4>::type B4;
1037 typedef list4<B1, B2, B3, B4> type;
1040 template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
1042 typedef typename add_value<A1>::type B1;
1043 typedef typename add_value<A2>::type B2;
1044 typedef typename add_value<A3>::type B3;
1045 typedef typename add_value<A4>::type B4;
1046 typedef typename add_value<A5>::type B5;
1047 typedef list5<B1, B2, B3, B4, B5> type;
1050 template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
1052 typedef typename add_value<A1>::type B1;
1053 typedef typename add_value<A2>::type B2;
1054 typedef typename add_value<A3>::type B3;
1055 typedef typename add_value<A4>::type B4;
1056 typedef typename add_value<A5>::type B5;
1057 typedef typename add_value<A6>::type B6;
1058 typedef list6<B1, B2, B3, B4, B5, B6> type;
1061 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
1063 typedef typename add_value<A1>::type B1;
1064 typedef typename add_value<A2>::type B2;
1065 typedef typename add_value<A3>::type B3;
1066 typedef typename add_value<A4>::type B4;
1067 typedef typename add_value<A5>::type B5;
1068 typedef typename add_value<A6>::type B6;
1069 typedef typename add_value<A7>::type B7;
1070 typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
1073 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
1075 typedef typename add_value<A1>::type B1;
1076 typedef typename add_value<A2>::type B2;
1077 typedef typename add_value<A3>::type B3;
1078 typedef typename add_value<A4>::type B4;
1079 typedef typename add_value<A5>::type B5;
1080 typedef typename add_value<A6>::type B6;
1081 typedef typename add_value<A7>::type B7;
1082 typedef typename add_value<A8>::type B8;
1083 typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
1086 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
1088 typedef typename add_value<A1>::type B1;
1089 typedef typename add_value<A2>::type B2;
1090 typedef typename add_value<A3>::type B3;
1091 typedef typename add_value<A4>::type B4;
1092 typedef typename add_value<A5>::type B5;
1093 typedef typename add_value<A6>::type B6;
1094 typedef typename add_value<A7>::type B7;
1095 typedef typename add_value<A8>::type B8;
1096 typedef typename add_value<A9>::type B9;
1097 typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
1104 template<class V, class T> void visit_each(V & v, _bi::value<T> const & t, int)
1106 BOOST_BIND_VISIT_EACH(v, t.get(), 0);
1109 template<class V, class R, class F, class L> void visit_each(V & v, _bi::bind_t<R, F, L> const & t, int)
1117 #define BOOST_BIND bind
1120 // generic function objects
1122 template<class R, class F>
1123 _bi::bind_t<R, F, _bi::list0>
1126 typedef _bi::list0 list_type;
1127 return _bi::bind_t<R, F, list_type> (f, list_type());
1130 template<class R, class F, class A1>
1131 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1132 BOOST_BIND(F f, A1 a1)
1134 typedef typename _bi::list_av_1<A1>::type list_type;
1135 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1138 template<class R, class F, class A1, class A2>
1139 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1140 BOOST_BIND(F f, A1 a1, A2 a2)
1142 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1143 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1146 template<class R, class F, class A1, class A2, class A3>
1147 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1148 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1150 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1151 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1154 template<class R, class F, class A1, class A2, class A3, class A4>
1155 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1156 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1158 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1159 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1162 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1163 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1164 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1166 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1167 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1170 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1171 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1172 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1174 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1175 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1178 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1179 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1180 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1182 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1183 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1186 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1187 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1188 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1190 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1191 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1194 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1195 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1196 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1198 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1199 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1202 // generic function objects, alternative syntax
1204 template<class R, class F>
1205 _bi::bind_t<R, F, _bi::list0>
1206 BOOST_BIND(boost::type<R>, F f)
1208 typedef _bi::list0 list_type;
1209 return _bi::bind_t<R, F, list_type> (f, list_type());
1212 template<class R, class F, class A1>
1213 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1214 BOOST_BIND(boost::type<R>, F f, A1 a1)
1216 typedef typename _bi::list_av_1<A1>::type list_type;
1217 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1220 template<class R, class F, class A1, class A2>
1221 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1222 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
1224 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1225 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1228 template<class R, class F, class A1, class A2, class A3>
1229 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1230 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
1232 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1233 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1236 template<class R, class F, class A1, class A2, class A3, class A4>
1237 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1238 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
1240 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1241 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1244 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1245 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1246 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1248 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1249 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1252 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1253 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1254 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1256 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1257 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1260 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1261 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1262 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1264 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1265 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1268 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1269 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1270 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1272 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1273 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1276 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1277 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1278 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)
1280 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1281 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1284 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1286 // adaptable function objects
1289 _bi::bind_t<_bi::unspecified, F, _bi::list0>
1292 typedef _bi::list0 list_type;
1293 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
1296 template<class F, class A1>
1297 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
1298 BOOST_BIND(F f, A1 a1)
1300 typedef typename _bi::list_av_1<A1>::type list_type;
1301 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
1304 template<class F, class A1, class A2>
1305 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
1306 BOOST_BIND(F f, A1 a1, A2 a2)
1308 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1309 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
1312 template<class F, class A1, class A2, class A3>
1313 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
1314 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1316 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1317 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
1320 template<class F, class A1, class A2, class A3, class A4>
1321 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1322 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1324 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1325 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
1328 template<class F, class A1, class A2, class A3, class A4, class A5>
1329 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1330 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1332 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1333 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1336 template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
1337 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1338 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1340 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1341 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1344 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1345 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1346 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1348 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1349 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1352 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1353 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1354 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1356 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1357 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1360 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1361 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1362 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1364 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1365 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1368 #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1370 // function pointers
1372 #define BOOST_BIND_CC
1373 #define BOOST_BIND_ST
1375 #include <boost/bind/bind_cc.hpp>
1377 #undef BOOST_BIND_CC
1378 #undef BOOST_BIND_ST
1380 #ifdef BOOST_BIND_ENABLE_STDCALL
1382 #define BOOST_BIND_CC __stdcall
1383 #define BOOST_BIND_ST
1385 #include <boost/bind/bind_cc.hpp>
1387 #undef BOOST_BIND_CC
1388 #undef BOOST_BIND_ST
1392 #ifdef BOOST_BIND_ENABLE_FASTCALL
1394 #define BOOST_BIND_CC __fastcall
1395 #define BOOST_BIND_ST
1397 #include <boost/bind/bind_cc.hpp>
1399 #undef BOOST_BIND_CC
1400 #undef BOOST_BIND_ST
1404 #ifdef BOOST_BIND_ENABLE_PASCAL
1406 #define BOOST_BIND_ST pascal
1407 #define BOOST_BIND_CC
1409 #include <boost/bind/bind_cc.hpp>
1411 #undef BOOST_BIND_ST
1412 #undef BOOST_BIND_CC
1416 // member function pointers
1418 #define BOOST_BIND_MF_NAME(X) X
1419 #define BOOST_BIND_MF_CC
1421 #include <boost/bind/bind_mf_cc.hpp>
1423 #undef BOOST_BIND_MF_NAME
1424 #undef BOOST_BIND_MF_CC
1426 #ifdef BOOST_MEM_FN_ENABLE_STDCALL
1428 #define BOOST_BIND_MF_NAME(X) X##_stdcall
1429 #define BOOST_BIND_MF_CC __stdcall
1431 #include <boost/bind/bind_mf_cc.hpp>
1433 #undef BOOST_BIND_MF_NAME
1434 #undef BOOST_BIND_MF_CC
1438 #ifdef BOOST_MEM_FN_ENABLE_FASTCALL
1440 #define BOOST_BIND_MF_NAME(X) X##_fastcall
1441 #define BOOST_BIND_MF_CC __fastcall
1443 #include <boost/bind/bind_mf_cc.hpp>
1445 #undef BOOST_BIND_MF_NAME
1446 #undef BOOST_BIND_MF_CC
1450 // data member pointers
1454 #if defined(__GNUC__) && (__GNUC__ == 2)
1459 template<class T> struct add_cref
1461 typedef T const & type;
1464 template<class T> struct add_cref< T & >
1466 typedef T const & type;
1469 template<> struct add_cref<void>
1476 template<class R, class T, class A1>
1477 _bi::bind_t< typename _bi::add_cref<R>::type, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1478 BOOST_BIND(R T::*f, A1 a1)
1480 typedef _mfi::dm<R, T> F;
1481 typedef typename _bi::list_av_1<A1>::type list_type;
1482 return _bi::bind_t<typename _bi::add_cref<R>::type, F, list_type>(F(f), list_type(a1));
1487 template<class R, class T, class A1>
1488 _bi::bind_t< R const &, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1489 BOOST_BIND(R T::*f, A1 a1)
1491 typedef _mfi::dm<R, T> F;
1492 typedef typename _bi::list_av_1<A1>::type list_type;
1493 return _bi::bind_t<R const &, F, list_type>(F(f), list_type(a1));
1500 template<class R, class T, class A1>
1501 _bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1502 BOOST_BIND(R T::*f, A1 a1)
1504 typedef _mfi::dm<R, T> F;
1505 typedef typename _bi::list_av_1<A1>::type list_type;
1506 return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
1509 } // namespace boost
1511 #ifndef BOOST_BIND_NO_PLACEHOLDERS
1513 # include <boost/bind/placeholders.hpp>
1518 # pragma warning(default: 4512) // assignment operator could not be generated
1519 # pragma warning(pop)
1522 #endif // #ifndef BOOST_BIND_HPP_INCLUDED