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
15 // Copyright (c) 2005 Peter Dimov
17 // Distributed under the Boost Software License, Version 1.0. (See
18 // accompanying file LICENSE_1_0.txt or copy at
19 // http://www.boost.org/LICENSE_1_0.txt)
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>
29 #include <boost/visit_each.hpp>
30 #include <boost/detail/workaround.hpp>
32 // Borland-specific bug, visit_each() silently fails to produce code
34 #if defined(__BORLANDC__)
35 # define BOOST_BIND_VISIT_EACH boost::visit_each
37 # define BOOST_BIND_VISIT_EACH visit_each
41 # pragma warning(push)
42 # pragma warning(disable: 4512) // assignment operator could not be generated
48 namespace _bi // implementation details
53 template<class R, class F> struct result_traits
58 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
60 struct unspecified {};
62 template<class F> struct result_traits<unspecified, F>
64 typedef typename F::result_type type;
67 template<class F> struct result_traits< unspecified, reference_wrapper<F> >
69 typedef typename F::result_type type;
76 template<class T> bool ref_compare(T const & a, T const & b, long)
81 template<class T> bool ref_compare(reference_wrapper<T> const & a, reference_wrapper<T> const & b, int)
83 return a.get_pointer() == b.get_pointer();
86 // bind_t forward declaration for listN
88 template<class R, class F, class L> class bind_t;
92 template<class T> class value
96 value(T const & t): t_(t) {}
98 T & get() { return t_; }
99 T const & get() const { return t_; }
101 bool operator==(value const & rhs) const
113 template<class T> class type {};
117 template<class F> inline F & unwrap(F * f, long)
122 template<class F> inline F & unwrap(reference_wrapper<F> * f, int)
127 template<class F> inline F & unwrap(reference_wrapper<F> const * f, int)
132 #if !( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, <= 0x3004) )
134 template<class R, class T> inline _mfi::dm<R, T> unwrap(R T::* * pm, int)
136 return _mfi::dm<R, T>(*pm);
139 #if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
140 // IBM/VisualAge 6.0 is not able to handle this overload.
141 template<class R, class T> inline _mfi::dm<R, T> unwrap(R T::* const * pm, int)
143 return _mfi::dm<R, T>(*pm);
158 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
160 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
162 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
164 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); }
166 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); }
168 template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
170 return unwrap(&f, 0)();
173 template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
175 return unwrap(&f, 0)();
178 template<class F, class A> void operator()(type<void>, F & f, A &, int)
183 template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
188 template<class V> void accept(V &) const
192 bool operator==(list0 const &) const
198 template<class A1> class list1
202 explicit list1(A1 a1): a1_(a1) {}
204 A1 operator[] (boost::arg<1>) const { return a1_; }
206 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
208 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
210 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
212 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
214 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); }
216 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); }
218 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
220 return unwrap(&f, 0)(a[a1_]);
223 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
225 return unwrap(&f, 0)(a[a1_]);
228 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
230 unwrap(&f, 0)(a[a1_]);
233 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
235 unwrap(&f, 0)(a[a1_]);
238 template<class V> void accept(V & v) const
240 BOOST_BIND_VISIT_EACH(v, a1_, 0);
243 bool operator==(list1 const & rhs) const
245 return ref_compare(a1_, rhs.a1_, 0);
253 template<class A1, class A2> class list2
257 list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {}
259 A1 operator[] (boost::arg<1>) const { return a1_; }
260 A2 operator[] (boost::arg<2>) const { return a2_; }
262 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
263 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
265 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
267 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
269 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
271 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); }
273 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); }
275 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
277 return unwrap(&f, 0)(a[a1_], a[a2_]);
280 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
282 return unwrap(&f, 0)(a[a1_], a[a2_]);
285 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
287 unwrap(&f, 0)(a[a1_], a[a2_]);
290 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
292 unwrap(&f, 0)(a[a1_], a[a2_]);
295 template<class V> void accept(V & v) const
297 BOOST_BIND_VISIT_EACH(v, a1_, 0);
298 BOOST_BIND_VISIT_EACH(v, a2_, 0);
301 bool operator==(list2 const & rhs) const
303 return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0);
312 template<class A1, class A2, class A3> class list3
316 list3(A1 a1, A2 a2, A3 a3): a1_(a1), a2_(a2), a3_(a3) {}
318 A1 operator[] (boost::arg<1>) const { return a1_; }
319 A2 operator[] (boost::arg<2>) const { return a2_; }
320 A3 operator[] (boost::arg<3>) const { return a3_; }
322 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
323 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
324 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
326 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
328 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
330 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
332 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); }
334 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); }
336 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
338 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
341 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
343 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
346 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
348 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
351 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
353 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
356 template<class V> void accept(V & v) const
358 BOOST_BIND_VISIT_EACH(v, a1_, 0);
359 BOOST_BIND_VISIT_EACH(v, a2_, 0);
360 BOOST_BIND_VISIT_EACH(v, a3_, 0);
363 bool operator==(list3 const & rhs) const
365 return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0);
375 template<class A1, class A2, class A3, class A4> class list4
379 list4(A1 a1, A2 a2, A3 a3, A4 a4): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {}
381 A1 operator[] (boost::arg<1>) const { return a1_; }
382 A2 operator[] (boost::arg<2>) const { return a2_; }
383 A3 operator[] (boost::arg<3>) const { return a3_; }
384 A4 operator[] (boost::arg<4>) const { return a4_; }
386 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
387 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
388 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
389 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
391 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
393 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
395 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
397 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); }
399 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); }
401 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
403 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
406 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
408 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
411 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
413 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
416 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
418 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
421 template<class V> void accept(V & v) const
423 BOOST_BIND_VISIT_EACH(v, a1_, 0);
424 BOOST_BIND_VISIT_EACH(v, a2_, 0);
425 BOOST_BIND_VISIT_EACH(v, a3_, 0);
426 BOOST_BIND_VISIT_EACH(v, a4_, 0);
429 bool operator==(list4 const & rhs) const
432 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
433 ref_compare(a4_, rhs.a4_, 0);
444 template<class A1, class A2, class A3, class A4, class A5> class list5
448 list5(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {}
450 A1 operator[] (boost::arg<1>) const { return a1_; }
451 A2 operator[] (boost::arg<2>) const { return a2_; }
452 A3 operator[] (boost::arg<3>) const { return a3_; }
453 A4 operator[] (boost::arg<4>) const { return a4_; }
454 A5 operator[] (boost::arg<5>) const { return a5_; }
456 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
457 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
458 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
459 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
460 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
462 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
464 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
466 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
468 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); }
470 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); }
472 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
474 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
477 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
479 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
482 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
484 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
487 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
489 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
492 template<class V> void accept(V & v) const
494 BOOST_BIND_VISIT_EACH(v, a1_, 0);
495 BOOST_BIND_VISIT_EACH(v, a2_, 0);
496 BOOST_BIND_VISIT_EACH(v, a3_, 0);
497 BOOST_BIND_VISIT_EACH(v, a4_, 0);
498 BOOST_BIND_VISIT_EACH(v, a5_, 0);
501 bool operator==(list5 const & rhs) const
504 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
505 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0);
517 template<class A1, class A2, class A3, class A4, class A5, class A6> class list6
521 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) {}
523 A1 operator[] (boost::arg<1>) const { return a1_; }
524 A2 operator[] (boost::arg<2>) const { return a2_; }
525 A3 operator[] (boost::arg<3>) const { return a3_; }
526 A4 operator[] (boost::arg<4>) const { return a4_; }
527 A5 operator[] (boost::arg<5>) const { return a5_; }
528 A6 operator[] (boost::arg<6>) const { return a6_; }
530 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
531 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
532 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
533 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
534 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
535 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
537 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
539 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
541 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
543 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); }
545 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); }
547 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
549 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
552 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
554 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
557 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
559 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
562 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
564 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
567 template<class V> void accept(V & v) const
569 BOOST_BIND_VISIT_EACH(v, a1_, 0);
570 BOOST_BIND_VISIT_EACH(v, a2_, 0);
571 BOOST_BIND_VISIT_EACH(v, a3_, 0);
572 BOOST_BIND_VISIT_EACH(v, a4_, 0);
573 BOOST_BIND_VISIT_EACH(v, a5_, 0);
574 BOOST_BIND_VISIT_EACH(v, a6_, 0);
577 bool operator==(list6 const & rhs) const
580 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
581 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0);
594 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7
598 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) {}
600 A1 operator[] (boost::arg<1>) const { return a1_; }
601 A2 operator[] (boost::arg<2>) const { return a2_; }
602 A3 operator[] (boost::arg<3>) const { return a3_; }
603 A4 operator[] (boost::arg<4>) const { return a4_; }
604 A5 operator[] (boost::arg<5>) const { return a5_; }
605 A6 operator[] (boost::arg<6>) const { return a6_; }
606 A7 operator[] (boost::arg<7>) const { return a7_; }
608 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
609 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
610 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
611 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
612 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
613 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
614 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
616 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
618 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
620 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
622 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); }
624 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); }
626 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
628 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
631 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
633 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
636 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
638 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
641 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
643 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
646 template<class V> void accept(V & v) const
648 BOOST_BIND_VISIT_EACH(v, a1_, 0);
649 BOOST_BIND_VISIT_EACH(v, a2_, 0);
650 BOOST_BIND_VISIT_EACH(v, a3_, 0);
651 BOOST_BIND_VISIT_EACH(v, a4_, 0);
652 BOOST_BIND_VISIT_EACH(v, a5_, 0);
653 BOOST_BIND_VISIT_EACH(v, a6_, 0);
654 BOOST_BIND_VISIT_EACH(v, a7_, 0);
657 bool operator==(list7 const & rhs) const
660 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
661 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
662 ref_compare(a7_, rhs.a7_, 0);
676 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class list8
680 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) {}
682 A1 operator[] (boost::arg<1>) const { return a1_; }
683 A2 operator[] (boost::arg<2>) const { return a2_; }
684 A3 operator[] (boost::arg<3>) const { return a3_; }
685 A4 operator[] (boost::arg<4>) const { return a4_; }
686 A5 operator[] (boost::arg<5>) const { return a5_; }
687 A6 operator[] (boost::arg<6>) const { return a6_; }
688 A7 operator[] (boost::arg<7>) const { return a7_; }
689 A8 operator[] (boost::arg<8>) const { return a8_; }
691 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
692 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
693 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
694 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
695 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
696 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
697 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
698 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
700 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
702 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
704 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
706 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); }
708 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); }
710 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
712 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
715 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
717 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
720 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
722 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
725 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
727 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
730 template<class V> void accept(V & v) const
732 BOOST_BIND_VISIT_EACH(v, a1_, 0);
733 BOOST_BIND_VISIT_EACH(v, a2_, 0);
734 BOOST_BIND_VISIT_EACH(v, a3_, 0);
735 BOOST_BIND_VISIT_EACH(v, a4_, 0);
736 BOOST_BIND_VISIT_EACH(v, a5_, 0);
737 BOOST_BIND_VISIT_EACH(v, a6_, 0);
738 BOOST_BIND_VISIT_EACH(v, a7_, 0);
739 BOOST_BIND_VISIT_EACH(v, a8_, 0);
742 bool operator==(list8 const & rhs) const
745 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
746 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
747 ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0);
762 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9
766 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) {}
768 A1 operator[] (boost::arg<1>) const { return a1_; }
769 A2 operator[] (boost::arg<2>) const { return a2_; }
770 A3 operator[] (boost::arg<3>) const { return a3_; }
771 A4 operator[] (boost::arg<4>) const { return a4_; }
772 A5 operator[] (boost::arg<5>) const { return a5_; }
773 A6 operator[] (boost::arg<6>) const { return a6_; }
774 A7 operator[] (boost::arg<7>) const { return a7_; }
775 A8 operator[] (boost::arg<8>) const { return a8_; }
776 A9 operator[] (boost::arg<9>) const { return a9_; }
778 A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
779 A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
780 A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
781 A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
782 A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
783 A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
784 A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
785 A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
786 A9 operator[] (boost::arg<9> (*) ()) const { return a9_; }
788 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
790 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
792 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
794 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); }
796 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); }
798 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
800 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
803 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
805 return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
808 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
810 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
813 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
815 unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
818 template<class V> void accept(V & v) const
820 BOOST_BIND_VISIT_EACH(v, a1_, 0);
821 BOOST_BIND_VISIT_EACH(v, a2_, 0);
822 BOOST_BIND_VISIT_EACH(v, a3_, 0);
823 BOOST_BIND_VISIT_EACH(v, a4_, 0);
824 BOOST_BIND_VISIT_EACH(v, a5_, 0);
825 BOOST_BIND_VISIT_EACH(v, a6_, 0);
826 BOOST_BIND_VISIT_EACH(v, a7_, 0);
827 BOOST_BIND_VISIT_EACH(v, a8_, 0);
828 BOOST_BIND_VISIT_EACH(v, a9_, 0);
831 bool operator==(list9 const & rhs) const
834 ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
835 ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
836 ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0) && ref_compare(a9_, rhs.a9_, 0);
854 #ifndef BOOST_NO_VOID_RETURNS
856 template<class R, class F, class L> class bind_t
860 typedef bind_t this_type;
862 bind_t(F f, L const & l): f_(f), l_(l) {}
864 #define BOOST_BIND_RETURN return
865 #include <boost/bind/bind_template.hpp>
866 #undef BOOST_BIND_RETURN
872 template<class R> struct bind_t_generator
875 template<class F, class L> class implementation
879 typedef implementation this_type;
881 implementation(F f, L const & l): f_(f), l_(l) {}
883 #define BOOST_BIND_RETURN return
884 #include <boost/bind/bind_template.hpp>
885 #undef BOOST_BIND_RETURN
891 template<> struct bind_t_generator<void>
894 template<class F, class L> class implementation
902 typedef implementation this_type;
904 implementation(F f, L const & l): f_(f), l_(l) {}
906 #define BOOST_BIND_RETURN
907 #include <boost/bind/bind_template.hpp>
908 #undef BOOST_BIND_RETURN
914 template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
918 bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
926 #ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
928 // put overloads in _bi, rely on ADL
930 # ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
932 template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
939 template<class R, class F, class L> bool function_equal_impl( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
944 # endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
946 #else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
948 // put overloads in boost
952 # ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
954 template<class R, class F, class L> bool function_equal( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b )
961 template<class R, class F, class L> bool function_equal_impl( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b, int )
966 # endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
971 #endif // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
975 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
977 template<class T> struct add_value
979 typedef _bi::value<T> type;
982 template<class T> struct add_value< value<T> >
984 typedef _bi::value<T> type;
987 template<class T> struct add_value< reference_wrapper<T> >
989 typedef reference_wrapper<T> type;
992 template<int I> struct add_value< arg<I> >
994 typedef boost::arg<I> type;
997 template<int I> struct add_value< arg<I> (*) () >
999 typedef boost::arg<I> (*type) ();
1002 template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
1004 typedef bind_t<R, F, L> type;
1009 template<int I> struct _avt_0;
1011 template<> struct _avt_0<1>
1013 template<class T> struct inner
1019 template<> struct _avt_0<2>
1021 template<class T> struct inner
1023 typedef value<T> type;
1027 typedef char (&_avt_r1) [1];
1028 typedef char (&_avt_r2) [2];
1030 template<class T> _avt_r1 _avt_f(value<T>);
1031 template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
1032 template<int I> _avt_r1 _avt_f(arg<I>);
1033 template<int I> _avt_r1 _avt_f(arg<I> (*) ());
1034 template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
1036 _avt_r2 _avt_f(...);
1038 template<class T> struct add_value
1041 typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
1048 template<class A1> struct list_av_1
1050 typedef typename add_value<A1>::type B1;
1051 typedef list1<B1> type;
1054 template<class A1, class A2> struct list_av_2
1056 typedef typename add_value<A1>::type B1;
1057 typedef typename add_value<A2>::type B2;
1058 typedef list2<B1, B2> type;
1061 template<class A1, class A2, class A3> struct list_av_3
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 list3<B1, B2, B3> type;
1069 template<class A1, class A2, class A3, class A4> struct list_av_4
1071 typedef typename add_value<A1>::type B1;
1072 typedef typename add_value<A2>::type B2;
1073 typedef typename add_value<A3>::type B3;
1074 typedef typename add_value<A4>::type B4;
1075 typedef list4<B1, B2, B3, B4> type;
1078 template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
1080 typedef typename add_value<A1>::type B1;
1081 typedef typename add_value<A2>::type B2;
1082 typedef typename add_value<A3>::type B3;
1083 typedef typename add_value<A4>::type B4;
1084 typedef typename add_value<A5>::type B5;
1085 typedef list5<B1, B2, B3, B4, B5> type;
1088 template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
1090 typedef typename add_value<A1>::type B1;
1091 typedef typename add_value<A2>::type B2;
1092 typedef typename add_value<A3>::type B3;
1093 typedef typename add_value<A4>::type B4;
1094 typedef typename add_value<A5>::type B5;
1095 typedef typename add_value<A6>::type B6;
1096 typedef list6<B1, B2, B3, B4, B5, B6> type;
1099 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
1101 typedef typename add_value<A1>::type B1;
1102 typedef typename add_value<A2>::type B2;
1103 typedef typename add_value<A3>::type B3;
1104 typedef typename add_value<A4>::type B4;
1105 typedef typename add_value<A5>::type B5;
1106 typedef typename add_value<A6>::type B6;
1107 typedef typename add_value<A7>::type B7;
1108 typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
1111 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
1113 typedef typename add_value<A1>::type B1;
1114 typedef typename add_value<A2>::type B2;
1115 typedef typename add_value<A3>::type B3;
1116 typedef typename add_value<A4>::type B4;
1117 typedef typename add_value<A5>::type B5;
1118 typedef typename add_value<A6>::type B6;
1119 typedef typename add_value<A7>::type B7;
1120 typedef typename add_value<A8>::type B8;
1121 typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
1124 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
1126 typedef typename add_value<A1>::type B1;
1127 typedef typename add_value<A2>::type B2;
1128 typedef typename add_value<A3>::type B3;
1129 typedef typename add_value<A4>::type B4;
1130 typedef typename add_value<A5>::type B5;
1131 typedef typename add_value<A6>::type B6;
1132 typedef typename add_value<A7>::type B7;
1133 typedef typename add_value<A8>::type B8;
1134 typedef typename add_value<A9>::type B9;
1135 typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
1142 template<class V> bool operator()(V const & v) const { return !v; }
1145 template<class R, class F, class L>
1146 bind_t< bool, logical_not, list1< bind_t<R, F, L> > >
1147 operator! (bind_t<R, F, L> const & f)
1149 typedef list1< bind_t<R, F, L> > list_type;
1150 return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
1153 // relational operators
1155 #define BOOST_BIND_OPERATOR( op, name ) \
1159 template<class V, class W> bool operator()(V const & v, W const & w) const { return v op w; } \
1162 template<class R, class F, class L, class A2> \
1163 bind_t< bool, name, list2< bind_t<R, F, L>, typename add_value<A2>::type > > \
1164 operator op (bind_t<R, F, L> const & f, A2 a2) \
1166 typedef typename add_value<A2>::type B2; \
1167 typedef list2< bind_t<R, F, L>, B2> list_type; \
1168 return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
1171 BOOST_BIND_OPERATOR( ==, equal )
1172 BOOST_BIND_OPERATOR( !=, not_equal )
1174 BOOST_BIND_OPERATOR( <, less )
1175 BOOST_BIND_OPERATOR( <=, less_equal )
1177 BOOST_BIND_OPERATOR( >, greater )
1178 BOOST_BIND_OPERATOR( >=, greater_equal )
1180 #undef BOOST_BIND_OPERATOR
1182 #if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3)
1184 // resolve ambiguity with rel_ops
1186 #define BOOST_BIND_OPERATOR( op, name ) \
1188 template<class R, class F, class L> \
1189 bind_t< bool, name, list2< bind_t<R, F, L>, bind_t<R, F, L> > > \
1190 operator op (bind_t<R, F, L> const & f, bind_t<R, F, L> const & g) \
1192 typedef list2< bind_t<R, F, L>, bind_t<R, F, L> > list_type; \
1193 return bind_t<bool, name, list_type> ( name(), list_type(f, g) ); \
1196 BOOST_BIND_OPERATOR( !=, not_equal )
1197 BOOST_BIND_OPERATOR( <=, less_equal )
1198 BOOST_BIND_OPERATOR( >, greater )
1199 BOOST_BIND_OPERATOR( >=, greater_equal )
1207 template<class V, class T> void visit_each(V & v, _bi::value<T> const & t, int)
1209 BOOST_BIND_VISIT_EACH(v, t.get(), 0);
1212 template<class V, class R, class F, class L> void visit_each(V & v, _bi::bind_t<R, F, L> const & t, int)
1220 #define BOOST_BIND bind
1223 // generic function objects
1225 template<class R, class F>
1226 _bi::bind_t<R, F, _bi::list0>
1229 typedef _bi::list0 list_type;
1230 return _bi::bind_t<R, F, list_type> (f, list_type());
1233 template<class R, class F, class A1>
1234 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1235 BOOST_BIND(F f, A1 a1)
1237 typedef typename _bi::list_av_1<A1>::type list_type;
1238 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1241 template<class R, class F, class A1, class A2>
1242 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1243 BOOST_BIND(F f, A1 a1, A2 a2)
1245 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1246 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1249 template<class R, class F, class A1, class A2, class A3>
1250 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1251 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1253 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1254 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1257 template<class R, class F, class A1, class A2, class A3, class A4>
1258 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1259 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1261 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1262 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1265 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1266 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1267 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1269 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1270 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1273 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1274 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1275 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1277 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1278 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1281 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1282 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1283 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1285 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1286 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1289 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1290 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1291 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1293 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1294 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1297 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1298 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1299 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1301 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1302 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1305 // generic function objects, alternative syntax
1307 template<class R, class F>
1308 _bi::bind_t<R, F, _bi::list0>
1309 BOOST_BIND(boost::type<R>, F f)
1311 typedef _bi::list0 list_type;
1312 return _bi::bind_t<R, F, list_type> (f, list_type());
1315 template<class R, class F, class A1>
1316 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1317 BOOST_BIND(boost::type<R>, F f, A1 a1)
1319 typedef typename _bi::list_av_1<A1>::type list_type;
1320 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1323 template<class R, class F, class A1, class A2>
1324 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1325 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
1327 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1328 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1331 template<class R, class F, class A1, class A2, class A3>
1332 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1333 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
1335 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1336 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1339 template<class R, class F, class A1, class A2, class A3, class A4>
1340 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1341 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
1343 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1344 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1347 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1348 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1349 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1351 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1352 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1355 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1356 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1357 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1359 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1360 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1363 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1364 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1365 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1367 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1368 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1371 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1372 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1373 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1375 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1376 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1379 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1380 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1381 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)
1383 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1384 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1387 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1389 // adaptable function objects
1392 _bi::bind_t<_bi::unspecified, F, _bi::list0>
1395 typedef _bi::list0 list_type;
1396 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
1399 template<class F, class A1>
1400 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
1401 BOOST_BIND(F f, A1 a1)
1403 typedef typename _bi::list_av_1<A1>::type list_type;
1404 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
1407 template<class F, class A1, class A2>
1408 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
1409 BOOST_BIND(F f, A1 a1, A2 a2)
1411 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1412 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
1415 template<class F, class A1, class A2, class A3>
1416 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
1417 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1419 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1420 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
1423 template<class F, class A1, class A2, class A3, class A4>
1424 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1425 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1427 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1428 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
1431 template<class F, class A1, class A2, class A3, class A4, class A5>
1432 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1433 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1435 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1436 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1439 template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
1440 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1441 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1443 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1444 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1447 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1448 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1449 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1451 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1452 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1455 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1456 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1457 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1459 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1460 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1463 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1464 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1465 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1467 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1468 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1471 #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1473 // function pointers
1475 #define BOOST_BIND_CC
1476 #define BOOST_BIND_ST
1478 #include <boost/bind/bind_cc.hpp>
1480 #undef BOOST_BIND_CC
1481 #undef BOOST_BIND_ST
1483 #ifdef BOOST_BIND_ENABLE_STDCALL
1485 #define BOOST_BIND_CC __stdcall
1486 #define BOOST_BIND_ST
1488 #include <boost/bind/bind_cc.hpp>
1490 #undef BOOST_BIND_CC
1491 #undef BOOST_BIND_ST
1495 #ifdef BOOST_BIND_ENABLE_FASTCALL
1497 #define BOOST_BIND_CC __fastcall
1498 #define BOOST_BIND_ST
1500 #include <boost/bind/bind_cc.hpp>
1502 #undef BOOST_BIND_CC
1503 #undef BOOST_BIND_ST
1507 #ifdef BOOST_BIND_ENABLE_PASCAL
1509 #define BOOST_BIND_ST pascal
1510 #define BOOST_BIND_CC
1512 #include <boost/bind/bind_cc.hpp>
1514 #undef BOOST_BIND_ST
1515 #undef BOOST_BIND_CC
1519 // member function pointers
1521 #define BOOST_BIND_MF_NAME(X) X
1522 #define BOOST_BIND_MF_CC
1524 #include <boost/bind/bind_mf_cc.hpp>
1526 #undef BOOST_BIND_MF_NAME
1527 #undef BOOST_BIND_MF_CC
1529 #ifdef BOOST_MEM_FN_ENABLE_CDECL
1531 #define BOOST_BIND_MF_NAME(X) X##_cdecl
1532 #define BOOST_BIND_MF_CC __cdecl
1534 #include <boost/bind/bind_mf_cc.hpp>
1536 #undef BOOST_BIND_MF_NAME
1537 #undef BOOST_BIND_MF_CC
1541 #ifdef BOOST_MEM_FN_ENABLE_STDCALL
1543 #define BOOST_BIND_MF_NAME(X) X##_stdcall
1544 #define BOOST_BIND_MF_CC __stdcall
1546 #include <boost/bind/bind_mf_cc.hpp>
1548 #undef BOOST_BIND_MF_NAME
1549 #undef BOOST_BIND_MF_CC
1553 #ifdef BOOST_MEM_FN_ENABLE_FASTCALL
1555 #define BOOST_BIND_MF_NAME(X) X##_fastcall
1556 #define BOOST_BIND_MF_CC __fastcall
1558 #include <boost/bind/bind_mf_cc.hpp>
1560 #undef BOOST_BIND_MF_NAME
1561 #undef BOOST_BIND_MF_CC
1565 // data member pointers
1569 #if defined(__GNUC__) && (__GNUC__ == 2)
1574 template<class T> struct add_cref
1576 typedef T const & type;
1579 template<class T> struct add_cref< T & >
1581 typedef T const & type;
1584 template<> struct add_cref<void>
1591 template<class R, class T, class A1>
1592 _bi::bind_t< typename _bi::add_cref<R>::type, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1593 BOOST_BIND(R T::*f, A1 a1)
1595 typedef _mfi::dm<R, T> F;
1596 typedef typename _bi::list_av_1<A1>::type list_type;
1597 return _bi::bind_t<typename _bi::add_cref<R>::type, F, list_type>(F(f), list_type(a1));
1602 template<class R, class T, class A1>
1603 _bi::bind_t< R const &, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1604 BOOST_BIND(R T::*f, A1 a1)
1606 typedef _mfi::dm<R, T> F;
1607 typedef typename _bi::list_av_1<A1>::type list_type;
1608 return _bi::bind_t<R const &, F, list_type>(F(f), list_type(a1));
1615 template<class R, class T, class A1>
1616 _bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1617 BOOST_BIND(R T::*f, A1 a1)
1619 typedef _mfi::dm<R, T> F;
1620 typedef typename _bi::list_av_1<A1>::type list_type;
1621 return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
1624 } // namespace boost
1626 #ifndef BOOST_BIND_NO_PLACEHOLDERS
1628 # include <boost/bind/placeholders.hpp>
1633 # pragma warning(default: 4512) // assignment operator could not be generated
1634 # pragma warning(pop)
1637 #endif // #ifndef BOOST_BIND_HPP_INCLUDED