#ifndef BOOST_BIND_HPP_INCLUDED #define BOOST_BIND_HPP_INCLUDED #if _MSC_VER+0 >= 1020 #pragma once #endif // // bind.hpp - binds function objects to arguments // // Copyright (c) 2001 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001 David Abrahams // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // // See http://www.boost.org/libs/bind/bind.html for documentation. // #include #include #include namespace boost { namespace _bi // implementation details { // result_traits template struct result_traits { typedef R type; }; #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) struct unspecified {}; template struct result_traits { typedef typename F::result_type type; }; #endif // bind_t forward declaration for listN template class bind_t; // value template class value { public: value(T const & t): t_(t) {} T & get() { return t_; } T const & get() const { return t_; } private: T t_; value & operator= (value const &); }; // arg template class arg {}; // type template class type {}; // listN template struct evaluator0; template struct evaluator1; template struct evaluator2; template struct evaluator3; template struct evaluator4; template struct evaluator5; template struct evaluator6; template struct evaluator7; template struct evaluator8; template struct evaluator9; class list0 { public: list0() {} template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator0 type; }; template void accept(V &) const { } private: list0 & operator= (list0 const &); }; template class list1 { public: explicit list1(A1 a1): a1_(a1) {} A1 operator[] (arg<1>) const { return a1_; } template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator1 type; }; template void accept(V & v) const { v(a1_); } A1 a1_; private: list1 & operator= (list1 const &); }; template class list2 { public: list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {} A1 operator[] (arg<1>) const { return a1_; } A2 operator[] (arg<2>) const { return a2_; } template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator2 type; }; template void accept(V & v) const { v(a1_); v(a2_); } A1 a1_; A2 a2_; private: list2 & operator= (list2 const &); }; template class list3 { public: list3(A1 a1, A2 a2, A3 a3): a1_(a1), a2_(a2), a3_(a3) {} A1 operator[] (arg<1>) const { return a1_; } A2 operator[] (arg<2>) const { return a2_; } A3 operator[] (arg<3>) const { return a3_; } template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator3 type; }; template void accept(V & v) const { v(a1_); v(a2_); v(a3_); } A1 a1_; A2 a2_; A3 a3_; private: list3 & operator= (list3 const &); }; template class list4 { public: list4(A1 a1, A2 a2, A3 a3, A4 a4): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {} A1 operator[] (arg<1>) const { return a1_; } A2 operator[] (arg<2>) const { return a2_; } A3 operator[] (arg<3>) const { return a3_; } A4 operator[] (arg<4>) const { return a4_; } template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator4 type; }; template void accept(V & v) const { v(a1_); v(a2_); v(a3_); v(a4_); } A1 a1_; A2 a2_; A3 a3_; A4 a4_; private: list4 & operator= (list4 const &); }; template class list5 { public: list5(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {} A1 operator[] (arg<1>) const { return a1_; } A2 operator[] (arg<2>) const { return a2_; } A3 operator[] (arg<3>) const { return a3_; } A4 operator[] (arg<4>) const { return a4_; } A5 operator[] (arg<5>) const { return a5_; } template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator5 type; }; template void accept(V & v) const { v(a1_); v(a2_); v(a3_); v(a4_); v(a5_); } A1 a1_; A2 a2_; A3 a3_; A4 a4_; A5 a5_; private: list5 & operator= (list5 const &); }; template class list6 { public: 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) {} A1 operator[] (arg<1>) const { return a1_; } A2 operator[] (arg<2>) const { return a2_; } A3 operator[] (arg<3>) const { return a3_; } A4 operator[] (arg<4>) const { return a4_; } A5 operator[] (arg<5>) const { return a5_; } A6 operator[] (arg<6>) const { return a6_; } template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator6 type; }; template void accept(V & v) const { v(a1_); v(a2_); v(a3_); v(a4_); v(a5_); v(a6_); } A1 a1_; A2 a2_; A3 a3_; A4 a4_; A5 a5_; A6 a6_; private: list6 & operator= (list6 const &); }; template class list7 { public: 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) {} A1 operator[] (arg<1>) const { return a1_; } A2 operator[] (arg<2>) const { return a2_; } A3 operator[] (arg<3>) const { return a3_; } A4 operator[] (arg<4>) const { return a4_; } A5 operator[] (arg<5>) const { return a5_; } A6 operator[] (arg<6>) const { return a6_; } A7 operator[] (arg<7>) const { return a7_; } template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator7 type; }; template void accept(V & v) const { v(a1_); v(a2_); v(a3_); v(a4_); v(a5_); v(a6_); v(a7_); } A1 a1_; A2 a2_; A3 a3_; A4 a4_; A5 a5_; A6 a6_; A7 a7_; private: list7 & operator= (list7 const &); }; template class list8 { public: 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) {} A1 operator[] (arg<1>) const { return a1_; } A2 operator[] (arg<2>) const { return a2_; } A3 operator[] (arg<3>) const { return a3_; } A4 operator[] (arg<4>) const { return a4_; } A5 operator[] (arg<5>) const { return a5_; } A6 operator[] (arg<6>) const { return a6_; } A7 operator[] (arg<7>) const { return a7_; } A8 operator[] (arg<8>) const { return a8_; } template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator8 type; }; template void accept(V & v) const { v(a1_); v(a2_); v(a3_); v(a4_); v(a5_); v(a6_); v(a7_); v(a8_); } A1 a1_; A2 a2_; A3 a3_; A4 a4_; A5 a5_; A6 a6_; A7 a7_; A8 a8_; private: list8 & operator= (list8 const &); }; template class list9 { public: 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) {} A1 operator[] (arg<1>) const { return a1_; } A2 operator[] (arg<2>) const { return a2_; } A3 operator[] (arg<3>) const { return a3_; } A4 operator[] (arg<4>) const { return a4_; } A5 operator[] (arg<5>) const { return a5_; } A6 operator[] (arg<6>) const { return a6_; } A7 operator[] (arg<7>) const { return a7_; } A8 operator[] (arg<8>) const { return a8_; } A9 operator[] (arg<9>) const { return a9_; } template T & operator[] (value & v) const { return v.get(); } template T const & operator[] (value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } template struct evaluator { typedef evaluator9 type; }; template void accept(V & v) const { v(a1_); v(a2_); v(a3_); v(a4_); v(a5_); v(a6_); v(a7_); v(a8_); v(a9_); } A1 a1_; A2 a2_; A3 a3_; A4 a4_; A5 a5_; A6 a6_; A7 a7_; A8 a8_; A9 a9_; private: list9 & operator= (list9 const &); }; // bind_t template struct evaluator0 { template static R eval(L const&, F f, A &) { return f(); } }; template <> struct evaluator0 { template static void eval(L const&, F f, A &) { f(); } }; template struct evaluator1 { template static R eval(L const& l, F f, A & a) { return f(a[l.a1_]); } }; template <> struct evaluator1 { template static void eval(L const& l, F f, A & a) { f(a[l.a1_]); } }; template struct evaluator2 { template static R eval(L const& l, F f, A & a) { return f(a[l.a1_], a[l.a2_]); } }; template <> struct evaluator2 { template static void eval(L const& l, F f, A & a) { f(a[l.a1_], a[l.a2_]); } }; template struct evaluator3 { template static R eval(L const& l, F f, A & a) { return f(a[l.a1_], a[l.a2_], a[l.a3_]); } }; template <> struct evaluator3 { template static void eval(L const& l, F f, A & a) { f(a[l.a1_], a[l.a2_], a[l.a3_]); } }; template struct evaluator4 { template static R eval(L const& l, F f, A & a) { return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]); } }; template <> struct evaluator4 { template static void eval(L const& l, F f, A & a) { f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]); } }; template struct evaluator5 { template static R eval(L const& l, F f, A & a) { return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]); } }; template <> struct evaluator5 { template static void eval(L const& l, F f, A & a) { f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]); } }; template struct evaluator6 { template static R eval(L const& l, F f, A & a) { return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]); } }; template <> struct evaluator6 { template static void eval(L const& l, F f, A & a) { f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]); } }; template struct evaluator7 { template static R eval(L const& l, F f, A & a) { return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]); } }; template <> struct evaluator7 { template static void eval(L const& l, F f, A & a) { f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]); } }; template struct evaluator8 { template static R eval(L const& l, F f, A & a) { return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]); } }; template <> struct evaluator8 { template static void eval(L const& l, F f, A & a) { f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]); } }; template struct evaluator9 { template static R eval(L const& l, F f, A & a) { return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]); } }; template <> struct evaluator9 { template static void eval(L const& l, F f, A & a) { f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]); } }; template struct bind_t_generator { template struct implementation { typedef typename result_traits::type result_type; implementation(F f, L const & l): f_(f), l_(l) {} result_type operator()() { list0 a; typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } result_type operator()() const { list0 a; typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1) { list1 a(a1); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1) const { list1 a(a1); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2) { list2 a(a1, a2); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2) const { list2 a(a1, a2); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3) { list3 a(a1, a2, a3); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3) const { list3 a(a1, a2, a3); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) { list4 a(a1, a2, a3, a4); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const { list4 a(a1, a2, a3, a4); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) { list5 a(a1, a2, a3, a4, a5); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const { list5 a(a1, a2, a3, a4, a5); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) { list6 a(a1, a2, a3, a4, a5, a6); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const { list6 a(a1, a2, a3, a4, a5, a6); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) { list7 a(a1, a2, a3, a4, a5, a6, a7); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const { list7 a(a1, a2, a3, a4, a5, a6, a7); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) { list8 a(a1, a2, a3, a4, a5, a6, a7, a8); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const { list8 a(a1, a2, a3, a4, a5, a6, a7, a8); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) { list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const { list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type eval(A & a) { typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template result_type eval(A & a) const { typedef typename L::template evaluator::type evaluator; return evaluator::eval(l_, f_, a); } template void accept(V & v) const { v(f_); l_.accept(v); } private: F f_; L l_; implementation & operator= (implementation const &); }; }; template <> struct bind_t_generator { template struct implementation { typedef typename result_traits::type result_type; implementation(F f, L const & l): f_(f), l_(l) {} result_type operator()() { list0 a; typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } result_type operator()() const { list0 a; typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1) { list1 a(a1); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1) const { list1 a(a1); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2) { list2 a(a1, a2); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2) const { list2 a(a1, a2); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3) { list3 a(a1, a2, a3); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3) const { list3 a(a1, a2, a3); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) { list4 a(a1, a2, a3, a4); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const { list4 a(a1, a2, a3, a4); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) { list5 a(a1, a2, a3, a4, a5); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const { list5 a(a1, a2, a3, a4, a5); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) { list6 a(a1, a2, a3, a4, a5, a6); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const { list6 a(a1, a2, a3, a4, a5, a6); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) { list7 a(a1, a2, a3, a4, a5, a6, a7); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const { list7 a(a1, a2, a3, a4, a5, a6, a7); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) { list8 a(a1, a2, a3, a4, a5, a6, a7, a8); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const { list8 a(a1, a2, a3, a4, a5, a6, a7, a8); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) { list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const { list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type eval(A & a) { typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template result_type eval(A & a) const { typedef typename L::template evaluator::type evaluator; evaluator::eval(l_, f_, a); } template void accept(V & v) const { v(f_); l_.accept(v); } private: F f_; L l_; implementation & operator= (implementation const &); }; }; template class bind_t : public bind_t_generator::template implementation { typedef typename bind_t_generator::template implementation base; public: bind_t(F f, L const & l): base(f, l) {} }; // add_value #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct add_value { typedef value type; }; template struct add_value< value > { typedef value type; }; template struct add_value< reference_wrapper > { typedef reference_wrapper type; }; template struct add_value< arg > { typedef arg type; }; template struct add_value< bind_t > { typedef bind_t type; }; #else // template struct _avt_0; template struct _avt_0 // <1> { template struct inner { typedef T type; }; }; template<> struct _avt_0<2> { template struct inner { typedef value type; }; }; typedef char (&_avt_r1) [1]; typedef char (&_avt_r2) [2]; template _avt_r1 _avt_f(value); template _avt_r1 _avt_f(reference_wrapper); template _avt_r1 _avt_f(arg); template _avt_r1 _avt_f(bind_t); _avt_r2 _avt_f(...); template struct add_value { static T t(); typedef typename _avt_0::template inner::type type; }; #endif // list_av_N template struct list_av_1 { typedef typename add_value::type B1; typedef list1 type; }; template struct list_av_2 { typedef typename add_value::type B1; typedef typename add_value::type B2; typedef list2 type; }; template struct list_av_3 { typedef typename add_value::type B1; typedef typename add_value::type B2; typedef typename add_value::type B3; typedef list3 type; }; template struct list_av_4 { typedef typename add_value::type B1; typedef typename add_value::type B2; typedef typename add_value::type B3; typedef typename add_value::type B4; typedef list4 type; }; template struct list_av_5 { typedef typename add_value::type B1; typedef typename add_value::type B2; typedef typename add_value::type B3; typedef typename add_value::type B4; typedef typename add_value::type B5; typedef list5 type; }; template struct list_av_6 { typedef typename add_value::type B1; typedef typename add_value::type B2; typedef typename add_value::type B3; typedef typename add_value::type B4; typedef typename add_value::type B5; typedef typename add_value::type B6; typedef list6 type; }; template struct list_av_7 { typedef typename add_value::type B1; typedef typename add_value::type B2; typedef typename add_value::type B3; typedef typename add_value::type B4; typedef typename add_value::type B5; typedef typename add_value::type B6; typedef typename add_value::type B7; typedef list7 type; }; template struct list_av_8 { typedef typename add_value::type B1; typedef typename add_value::type B2; typedef typename add_value::type B3; typedef typename add_value::type B4; typedef typename add_value::type B5; typedef typename add_value::type B6; typedef typename add_value::type B7; typedef typename add_value::type B8; typedef list8 type; }; template struct list_av_9 { typedef typename add_value::type B1; typedef typename add_value::type B2; typedef typename add_value::type B3; typedef typename add_value::type B4; typedef typename add_value::type B5; typedef typename add_value::type B6; typedef typename add_value::type B7; typedef typename add_value::type B8; typedef typename add_value::type B9; typedef list9 type; }; } // namespace _bi // bind #ifndef BOOST_BIND #define BOOST_BIND bind #endif // generic function objects template _bi::bind_t BOOST_BIND(F f) { typedef _bi::list0 list_type; return _bi::bind_t (f, list_type()); } template _bi::bind_t::type> BOOST_BIND(F f, A1 a1) { typedef typename _bi::list_av_1::type list_type; return _bi::bind_t (f, list_type(a1)); } template _bi::bind_t::type> BOOST_BIND(F f, A1 a1, A2 a2) { typedef typename _bi::list_av_2::type list_type; return _bi::bind_t (f, list_type(a1, a2)); } template _bi::bind_t::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3) { typedef typename _bi::list_av_3::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3)); } template _bi::bind_t::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4) { typedef typename _bi::list_av_4::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4)); } template _bi::bind_t::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { typedef typename _bi::list_av_5::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5)); } template _bi::bind_t::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { typedef typename _bi::list_av_6::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6)); } template _bi::bind_t::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { typedef typename _bi::list_av_7::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7)); } template _bi::bind_t::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { typedef typename _bi::list_av_8::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8)); } template _bi::bind_t::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { typedef typename _bi::list_av_9::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); } #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) // adaptable function objects template _bi::bind_t<_bi::unspecified, F, _bi::list0> BOOST_BIND(F f) { typedef _bi::list0 list_type; return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type()); } template _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1::type> BOOST_BIND(F f, A1 a1) { typedef typename _bi::list_av_1::type list_type; return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1)); } template _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2::type> BOOST_BIND(F f, A1 a1, A2 a2) { typedef typename _bi::list_av_2::type list_type; return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2)); } template _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3) { typedef typename _bi::list_av_3::type list_type; return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3)); } template _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4) { typedef typename _bi::list_av_4::type list_type; return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4)); } template _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { typedef typename _bi::list_av_5::type list_type; return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5)); } template _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { typedef typename _bi::list_av_6::type list_type; return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6)); } template _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { typedef typename _bi::list_av_7::type list_type; return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7)); } template _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { typedef typename _bi::list_av_8::type list_type; return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8)); } template _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9::type> BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { typedef typename _bi::list_av_9::type list_type; return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); } #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) // function pointers #if defined(BOOST_BIND_ENABLE_STDCALL) #define BOOST_BIND_CC __stdcall #include #undef BOOST_BIND_CC #endif #define BOOST_BIND_CC #include #undef BOOST_BIND_CC // member function pointers #if defined(BOOST_MEM_FN_ENABLE_STDCALL) || (defined(BOOST_MSVC) && BOOST_MSVC <= 1300) #if defined(BOOST_MEM_FN_ENABLE_STDCALL) #define BOOST_BIND_MF_CC __stdcall #include #undef BOOST_BIND_MF_CC #endif #define BOOST_BIND_MF_CC #include #undef BOOST_BIND_MF_CC #else // 0 template _bi::bind_t, typename _bi::list_av_1::type> BOOST_BIND(R (T::*f) (), A1 a1) { typedef _mfi::mf0 F; typedef typename _bi::list_av_1::type list_type; return _bi::bind_t(F(f), list_type(a1)); } template _bi::bind_t, typename _bi::list_av_1::type> BOOST_BIND(R (T::*f) () const, A1 a1) { typedef _mfi::cmf0 F; typedef typename _bi::list_av_1::type list_type; return _bi::bind_t(F(f), list_type(a1)); } // 1 template _bi::bind_t, typename _bi::list_av_2::type> BOOST_BIND(R (T::*f) (B1), A1 a1, A2 a2) { typedef _mfi::mf1 F; typedef typename _bi::list_av_2::type list_type; return _bi::bind_t(F(f), list_type(a1, a2)); } template _bi::bind_t, typename _bi::list_av_2::type> BOOST_BIND(R (T::*f) (B1) const, A1 a1, A2 a2) { typedef _mfi::cmf1 F; typedef typename _bi::list_av_2::type list_type; return _bi::bind_t(F(f), list_type(a1, a2)); } // 2 template _bi::bind_t, typename _bi::list_av_3::type> BOOST_BIND(R (T::*f) (B1, B2), A1 a1, A2 a2, A3 a3) { typedef _mfi::mf2 F; typedef typename _bi::list_av_3::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3)); } template _bi::bind_t, typename _bi::list_av_3::type> BOOST_BIND(R (T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3) { typedef _mfi::cmf2 F; typedef typename _bi::list_av_3::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3)); } // 3 template _bi::bind_t, typename _bi::list_av_4::type> BOOST_BIND(R (T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4) { typedef _mfi::mf3 F; typedef typename _bi::list_av_4::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4)); } template _bi::bind_t, typename _bi::list_av_4::type> BOOST_BIND(R (T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4) { typedef _mfi::cmf3 F; typedef typename _bi::list_av_4::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4)); } // 4 template _bi::bind_t, typename _bi::list_av_5::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { typedef _mfi::mf4 F; typedef typename _bi::list_av_5::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5)); } template _bi::bind_t, typename _bi::list_av_5::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { typedef _mfi::cmf4 F; typedef typename _bi::list_av_5::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5)); } // 5 template _bi::bind_t, typename _bi::list_av_6::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { typedef _mfi::mf5 F; typedef typename _bi::list_av_6::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6)); } template _bi::bind_t, typename _bi::list_av_6::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { typedef _mfi::cmf5 F; typedef typename _bi::list_av_6::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6)); } // 6 template _bi::bind_t, typename _bi::list_av_7::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { typedef _mfi::mf6 F; typedef typename _bi::list_av_7::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7)); } template _bi::bind_t, typename _bi::list_av_7::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { typedef _mfi::cmf6 F; typedef typename _bi::list_av_7::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7)); } // 7 template _bi::bind_t, typename _bi::list_av_8::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { typedef _mfi::mf7 F; typedef typename _bi::list_av_8::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8)); } template _bi::bind_t, typename _bi::list_av_8::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { typedef _mfi::cmf7 F; typedef typename _bi::list_av_8::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8)); } // 8 template _bi::bind_t, typename _bi::list_av_9::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { typedef _mfi::mf8 F; typedef typename _bi::list_av_9::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); } template _bi::bind_t, typename _bi::list_av_9::type> BOOST_BIND(R (T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { typedef _mfi::cmf8 F; typedef typename _bi::list_av_9::type list_type; return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); } #endif // !defined(BOOST_MEM_FN_ENABLE_STDCALL) } // namespace boost namespace { boost::_bi::arg<1> _1; boost::_bi::arg<2> _2; boost::_bi::arg<3> _3; boost::_bi::arg<4> _4; boost::_bi::arg<5> _5; boost::_bi::arg<6> _6; boost::_bi::arg<7> _7; boost::_bi::arg<8> _8; boost::_bi::arg<9> _9; } #endif // #ifndef BOOST_BIND_HPP_INCLUDED