sl@0: // sl@0: // bind/bind_template.hpp sl@0: // sl@0: // Do not include this header directly. sl@0: // sl@0: // Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd. sl@0: // sl@0: // Distributed under the Boost Software License, Version 1.0. (See sl@0: // accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: // sl@0: // See http://www.boost.org/libs/bind/bind.html for documentation. sl@0: // sl@0: sl@0: typedef typename result_traits::type result_type; sl@0: sl@0: result_type operator()() sl@0: { sl@0: list0 a; sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: result_type operator()() const sl@0: { sl@0: list0 a; sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1) sl@0: { sl@0: list1 a(a1); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1) const sl@0: { sl@0: list1 a(a1); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: #if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ sl@0: && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) sl@0: sl@0: template result_type operator()(A1 const & a1) sl@0: { sl@0: list1 a(a1); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 const & a1) const sl@0: { sl@0: list1 a(a1); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: #endif sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2) sl@0: { sl@0: list2 a(a1, a2); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2) const sl@0: { sl@0: list2 a(a1, a2); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: #if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ sl@0: && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) sl@0: sl@0: template result_type operator()(A1 const & a1, A2 & a2) sl@0: { sl@0: list2 a(a1, a2); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 const & a1, A2 & a2) const sl@0: { sl@0: list2 a(a1, a2); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: sl@0: template result_type operator()(A1 & a1, A2 const & a2) sl@0: { sl@0: list2 a(a1, a2); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 const & a2) const sl@0: { sl@0: list2 a(a1, a2); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: sl@0: template result_type operator()(A1 const & a1, A2 const & a2) sl@0: { sl@0: list2 a(a1, a2); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 const & a1, A2 const & a2) const sl@0: { sl@0: list2 a(a1, a2); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: #endif sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3) sl@0: { sl@0: list3 a(a1, a2, a3); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3) const sl@0: { sl@0: list3 a(a1, a2, a3); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) sl@0: { sl@0: list4 a(a1, a2, a3, a4); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const sl@0: { sl@0: list4 a(a1, a2, a3, a4); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) sl@0: { sl@0: list5 a(a1, a2, a3, a4, a5); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const sl@0: { sl@0: list5 a(a1, a2, a3, a4, a5); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) sl@0: { sl@0: list6 a(a1, a2, a3, a4, a5, a6); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const sl@0: { sl@0: list6 a(a1, a2, a3, a4, a5, a6); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) sl@0: { sl@0: list7 a(a1, a2, a3, a4, a5, a6, a7); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const sl@0: { sl@0: list7 a(a1, a2, a3, a4, a5, a6, a7); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) sl@0: { sl@0: list8 a(a1, a2, a3, a4, a5, a6, a7, a8); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const sl@0: { sl@0: list8 a(a1, a2, a3, a4, a5, a6, a7, a8); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) sl@0: { sl@0: list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const sl@0: { sl@0: list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type eval(A & a) sl@0: { sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template result_type eval(A & a) const sl@0: { sl@0: BOOST_BIND_RETURN l_(type(), f_, a, 0); sl@0: } sl@0: sl@0: template void accept(V & v) const sl@0: { sl@0: #if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ ) sl@0: sl@0: using boost::visit_each; sl@0: sl@0: #endif sl@0: BOOST_BIND_VISIT_EACH(v, f_, 0); sl@0: l_.accept(v); sl@0: } sl@0: sl@0: bool compare(this_type const & rhs) const sl@0: { sl@0: return ref_compare(f_, rhs.f_, 0) && l_ == rhs.l_; sl@0: } sl@0: sl@0: private: sl@0: sl@0: F f_; sl@0: L l_;