From 5134310a5ecdff50ecb14030cdca9396fd9faee7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 21 Nov 2001 12:34:23 +0000 Subject: [PATCH] More regression fixes [SVN r11762] --- bind_test.cpp | 8 +- include/boost/bind.hpp | 620 ++++++++++----------------- include/boost/bind/bind_template.hpp | 157 +++++++ 3 files changed, 389 insertions(+), 396 deletions(-) create mode 100644 include/boost/bind/bind_template.hpp diff --git a/bind_test.cpp b/bind_test.cpp index d079902..ef88817 100644 --- a/bind_test.cpp +++ b/bind_test.cpp @@ -174,7 +174,7 @@ struct Y short operator()(short & r) const { return ++r; } int operator()(int a, int b) const { return a + 10 * b; } long operator() (long a, long b, long c) const { return a + 10 * b + 100 * c; } - void operator() (long a, long b, long c, const char*) const { global_result = a + 10 * b + 100 * c; } + void operator() (long a, long b, long c, long d) const { global_result = a + 10 * b + 100 * c + 1000 * d; } }; void function_object_test() @@ -189,9 +189,9 @@ void function_object_test() BOOST_TEST( bind(Y(), ref(i))() == 8 ); BOOST_TEST( bind(Y(), i, _1)(k) == 38 ); BOOST_TEST( bind(Y(), i, _1, 9)(k) == 938 ); -#if !defined(__MWERKS__) || __MWERKS__ > 0x2406 // Fails for this version of the compiler. - BOOST_TEST( (bind(Y(), i, _1, 9, "nothing")(k), (global_result == 938)) ); -#endif + + bind(Y(), i, _1, 9, 4)(k); + BOOST_TEST( global_result == 4938 ); } // diff --git a/include/boost/bind.hpp b/include/boost/bind.hpp index 195ac8a..8c31bd8 100644 --- a/include/boost/bind.hpp +++ b/include/boost/bind.hpp @@ -1,7 +1,7 @@ #ifndef BOOST_BIND_HPP_INCLUDED #define BOOST_BIND_HPP_INCLUDED -#if _MSC_VER+0 >= 1020 +#if _MSC_VER >= 1020 #pragma once #endif @@ -78,6 +78,8 @@ template class type {}; // listN +#ifdef BOOST_NO_VOID_RETURNS + template struct evaluator0; template struct evaluator1; template struct evaluator2; @@ -89,6 +91,8 @@ template struct evaluator7; template struct evaluator8; template struct evaluator9; +#endif + class list0 { public: @@ -105,16 +109,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A &) const { - typedef evaluator0 type; - }; - + return f(); + } + template void accept(V &) const { } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator0 type; + }; + +#endif + private: list0 & operator= (list0 const &); @@ -138,17 +150,29 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A & a) const { - typedef evaluator1 type; - }; - + return f(a[a1_]); + } + template void accept(V & v) const { v(a1_); } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator1 type; + }; + +#else + +private: + +#endif + A1 a1_; private: @@ -175,18 +199,30 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A & a) const { - typedef evaluator2 type; - }; - + return f(a[a1_], a[a2_]); + } + template void accept(V & v) const { v(a1_); v(a2_); } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator2 type; + }; + +#else + +private: + +#endif + A1 a1_; A2 a2_; @@ -215,12 +251,11 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A & a) const { - typedef evaluator3 type; - }; - + return f(a[a1_], a[a2_], a[a3_]); + } + template void accept(V & v) const { v(a1_); @@ -228,6 +263,19 @@ public: v(a3_); } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator3 type; + }; + +#else + +private: + +#endif + A1 a1_; A2 a2_; A3 a3_; @@ -258,12 +306,11 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A & a) const { - typedef evaluator4 type; - }; - + return f(a[a1_], a[a2_], a[a3_], a[a4_]); + } + template void accept(V & v) const { v(a1_); @@ -272,6 +319,19 @@ public: v(a4_); } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator4 type; + }; + +#else + +private: + +#endif + A1 a1_; A2 a2_; A3 a3_; @@ -304,12 +364,11 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A & a) const { - typedef evaluator5 type; - }; - + return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]); + } + template void accept(V & v) const { v(a1_); @@ -319,6 +378,19 @@ public: v(a5_); } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator5 type; + }; + +#else + +private: + +#endif + A1 a1_; A2 a2_; A3 a3_; @@ -353,12 +425,11 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A & a) const { - typedef evaluator6 type; - }; - + return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]); + } + template void accept(V & v) const { v(a1_); @@ -369,6 +440,19 @@ public: v(a6_); } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator6 type; + }; + +#else + +private: + +#endif + A1 a1_; A2 a2_; A3 a3_; @@ -405,12 +489,11 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A & a) const { - typedef evaluator7 type; - }; - + return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); + } + template void accept(V & v) const { v(a1_); @@ -422,6 +505,19 @@ public: v(a7_); } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator7 type; + }; + +#else + +private: + +#endif + A1 a1_; A2 a2_; A3 a3_; @@ -460,12 +556,11 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A & a) const { - typedef evaluator8 type; - }; - + return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]); + } + template void accept(V & v) const { v(a1_); @@ -478,6 +573,19 @@ public: v(a8_); } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator8 type; + }; + +#else + +private: + +#endif + A1 a1_; A2 a2_; A3 a3_; @@ -518,12 +626,11 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template - struct evaluator + template R operator()(type, F f, A & a) const { - typedef evaluator9 type; - }; - + return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]); + } + template void accept(V & v) const { v(a1_); @@ -537,6 +644,19 @@ public: v(a9_); } +#ifdef BOOST_NO_VOID_RETURNS + + template struct evaluator + { + typedef evaluator9 type; + }; + +#else + +private: + +#endif + A1 a1_; A2 a2_; A3 a3_; @@ -552,7 +672,7 @@ private: list9 & operator= (list9 const &); }; -// bind_t +#ifdef BOOST_NO_VOID_RETURNS template struct evaluator0 { @@ -734,358 +854,67 @@ template <> struct evaluator9 } }; -template -struct bind_t_generator +#endif + +// bind_t + +#ifndef BOOST_NO_VOID_RETURNS + +template class bind_t { - template - struct implementation - { - typedef typename result_traits::type result_type; +public: - implementation(F f, L const & l): f_(f), l_(l) {} + bind_t(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); - } +#define BOOST_BIND_EVALUATE return l_(type(), f_, a) +#include +#undef BOOST_BIND_EVALUATE private: - F f_; - L l_; - - implementation & operator= (implementation const &); - }; + bind_t & operator= (bind_t const &); }; -template <> -struct bind_t_generator +#else + +template struct bind_t_generator { - template - struct implementation - { - typedef typename result_traits::type result_type; + +template class implementation +{ +public: 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); - } +#define BOOST_BIND_EVALUATE return L::BOOST_NESTED_TEMPLATE evaluator::type::eval(l_, f_, a); +#include +#undef BOOST_BIND_EVALUATE private: - F f_; - L l_; + implementation & operator= (implementation const &); +}; + +}; + +template<> struct bind_t_generator +{ + +template class implementation +{ +public: + + implementation(F f, L const & l): f_(f), l_(l) {} + +#define BOOST_BIND_EVALUATE L::BOOST_NESTED_TEMPLATE evaluator::type::eval(l_, f_, a); +#include +#undef BOOST_BIND_EVALUATE + +private: implementation & operator= (implementation const &); - }; +}; + }; #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) @@ -1093,13 +922,18 @@ private: #pragma warning(disable: 4097) // typedef name 'base' used as a synonym for class #endif -template class bind_t - : public bind_t_generator::template implementation +template class bind_t: public bind_t_generator::BOOST_NESTED_TEMPLATE implementation { +private: + typedef typename bind_t_generator::template implementation base; - public: + +public: + bind_t(F f, L const & l): base(f, l) {} - private: + +private: + bind_t & operator= (bind_t const &); }; @@ -1107,9 +941,11 @@ template class bind_t #pragma warning(pop) #endif +#endif + // add_value -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC+0 >= 0x530) +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530) template struct add_value { diff --git a/include/boost/bind/bind_template.hpp b/include/boost/bind/bind_template.hpp new file mode 100644 index 0000000..0bfba91 --- /dev/null +++ b/include/boost/bind/bind_template.hpp @@ -0,0 +1,157 @@ +// +// bind/bind_template.hpp +// +// Do not include this header directly. +// +// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. +// +// 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. +// + + typedef typename result_traits::type result_type; + + result_type operator()() + { + list0 a; + BOOST_BIND_EVALUATE; + } + + result_type operator()() const + { + list0 a; + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1) + { + list1 a(a1); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1) const + { + list1 a(a1); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1, A2 & a2) + { + list2 a(a1, a2); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1, A2 & a2) const + { + list2 a(a1, a2); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1, A2 & a2, A3 & a3) + { + list3 a(a1, a2, a3); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1, A2 & a2, A3 & a3) const + { + list3 a(a1, a2, a3); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) + { + list4 a(a1, a2, a3, a4); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const + { + list4 a(a1, a2, a3, a4); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) + { + list5 a(a1, a2, a3, a4, a5); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const + { + list5 a(a1, a2, a3, a4, a5); + BOOST_BIND_EVALUATE; + } + + template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) + { + list6 a(a1, a2, a3, a4, a5, a6); + BOOST_BIND_EVALUATE; + } + + 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); + BOOST_BIND_EVALUATE; + } + + 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); + BOOST_BIND_EVALUATE; + } + + 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); + BOOST_BIND_EVALUATE; + } + + 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); + BOOST_BIND_EVALUATE; + } + + 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); + BOOST_BIND_EVALUATE; + } + + 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); + BOOST_BIND_EVALUATE; + } + + 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); + BOOST_BIND_EVALUATE; + } + + template result_type eval(A & a) + { + BOOST_BIND_EVALUATE; + } + + template result_type eval(A & a) const + { + BOOST_BIND_EVALUATE; + } + + template void accept(V & v) const + { + v(f_); + l_.accept(v); + } + +private: + + F f_; + L l_;