Chris@16: // Boost Lambda Library lambda_functor_base.hpp ----------------------------- Chris@16: // Chris@16: // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // For more information, see www.boost.org Chris@16: Chris@16: // ------------------------------------------------------------ Chris@16: Chris@16: #ifndef BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_HPP Chris@16: #define BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_HPP Chris@16: Chris@16: #include "boost/type_traits/add_reference.hpp" Chris@16: #include "boost/type_traits/add_const.hpp" Chris@16: #include "boost/type_traits/remove_const.hpp" Chris@16: #include "boost/lambda/detail/lambda_fwd.hpp" Chris@16: #include "boost/lambda/detail/lambda_traits.hpp" Chris@16: Chris@16: namespace boost { Chris@16: namespace lambda { Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) Chris@16: #pragma warning(push) Chris@16: #pragma warning(disable:4512) //assignment operator could not be generated Chris@16: #endif Chris@16: Chris@16: // for return type deductions we wrap bound argument to this class, Chris@16: // which fulfils the base class contract for lambda_functors Chris@16: template Chris@16: class identity { Chris@16: Chris@16: T elem; Chris@16: public: Chris@16: Chris@16: typedef T element_t; Chris@16: Chris@16: // take all parameters as const references. Note that non-const references Chris@16: // stay as they are. Chris@16: typedef typename boost::add_reference< Chris@16: typename boost::add_const::type Chris@16: >::type par_t; Chris@16: Chris@16: explicit identity(par_t t) : elem(t) {} Chris@16: Chris@16: template Chris@16: struct sig { typedef typename boost::remove_const::type type; }; Chris@16: Chris@16: template Chris@16: RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return elem; } Chris@16: }; Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) Chris@16: #pragma warning(pop) Chris@16: #endif Chris@16: Chris@16: template Chris@16: inline lambda_functor > var(T& t) { return identity(t); } Chris@16: Chris@16: // for lambda functors, var is an identity operator. It was forbidden Chris@16: // at some point, but we might want to var something that can be a Chris@16: // non-lambda functor or a lambda functor. Chris@16: template Chris@16: lambda_functor var(const lambda_functor& t) { return t; } Chris@16: Chris@16: template struct var_type { Chris@16: typedef lambda_functor > type; Chris@16: }; Chris@16: Chris@16: Chris@16: template Chris@16: inline Chris@16: lambda_functor::type> > Chris@16: constant(const T& t) { Chris@16: return identity::type>(t); Chris@16: } Chris@16: template Chris@16: lambda_functor constant(const lambda_functor& t) { return t; } Chris@16: Chris@16: template struct constant_type { Chris@16: typedef Chris@16: lambda_functor< Chris@16: identity::type> Chris@16: > type; Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: template Chris@16: inline lambda_functor > constant_ref(const T& t) { Chris@16: return identity(t); Chris@16: } Chris@16: template Chris@16: lambda_functor constant_ref(const lambda_functor& t) { return t; } Chris@16: Chris@16: template struct constant_ref_type { Chris@16: typedef Chris@16: lambda_functor > type; Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: // as_lambda_functor turns any types to lambda functors Chris@16: // non-lambda_functors will be bound argument types Chris@16: template Chris@16: struct as_lambda_functor { Chris@16: typedef typename Chris@16: detail::remove_reference_and_cv::type plain_T; Chris@16: typedef typename Chris@16: detail::IF::value, Chris@16: plain_T, Chris@16: lambda_functor< Chris@16: identity::type> Chris@16: > Chris@16: >::RET type; Chris@16: }; Chris@16: Chris@16: // turns arbitrary objects into lambda functors Chris@16: template Chris@16: inline Chris@16: lambda_functor::type> > Chris@16: to_lambda_functor(const T& t) { Chris@16: return identity::type>(t); Chris@16: } Chris@16: Chris@16: template Chris@16: inline lambda_functor Chris@16: to_lambda_functor(const lambda_functor& t) { Chris@16: return t; Chris@16: } Chris@16: Chris@16: namespace detail { Chris@16: Chris@16: Chris@16: Chris@16: // In a call constify_rvals::go(x) Chris@16: // x should be of type T. If T is a non-reference type, do Chris@16: // returns x as const reference. Chris@16: // Otherwise the type doesn't change. Chris@16: // The purpose of this class is to avoid Chris@16: // 'cannot bind temporaries to non-const references' errors. Chris@16: template struct constify_rvals { Chris@16: template Chris@16: static inline const U& go(const U& u) { return u; } Chris@16: }; Chris@16: Chris@16: template struct constify_rvals { Chris@16: template Chris@16: static inline U& go(U& u) { return u; } Chris@16: }; Chris@16: Chris@16: // check whether one of the elements of a tuple (cons list) is of type Chris@16: // null_type. Needed, because the compiler goes ahead and instantiates Chris@16: // sig template for nullary case even if the nullary operator() is not Chris@16: // called Chris@16: template struct is_null_type Chris@16: { BOOST_STATIC_CONSTANT(bool, value = false); }; Chris@16: Chris@16: template <> struct is_null_type Chris@16: { BOOST_STATIC_CONSTANT(bool, value = true); }; Chris@16: Chris@16: template struct has_null_type { Chris@16: BOOST_STATIC_CONSTANT(bool, value = (is_null_type::value || has_null_type::value)); Chris@16: }; Chris@16: template<> struct has_null_type { Chris@16: BOOST_STATIC_CONSTANT(bool, value = false); Chris@16: }; Chris@16: Chris@16: Chris@16: // helpers ------------------- Chris@16: Chris@16: Chris@16: template Chris@16: class deduce_argument_types_ { Chris@16: typedef typename as_lambda_functor::type lf_t; Chris@16: typedef typename lf_t::inherited::template sig::type el_t; Chris@16: public: Chris@16: typedef Chris@16: boost::tuples::cons< Chris@16: el_t, Chris@16: typename deduce_argument_types_::type Chris@16: > type; Chris@16: }; Chris@16: Chris@16: template Chris@16: class deduce_argument_types_ { Chris@16: public: Chris@16: typedef null_type type; Chris@16: }; Chris@16: Chris@16: Chris@16: // // note that tuples cannot have plain function types as elements. Chris@16: // // Hence, all other types will be non-const, except references to Chris@16: // // functions. Chris@16: // template struct remove_reference_except_from_functions { Chris@16: // typedef typename boost::remove_reference::type t; Chris@16: // typedef typename detail::IF::value, T, t>::RET type; Chris@16: // }; Chris@16: Chris@16: template Chris@16: class deduce_non_ref_argument_types_ { Chris@16: typedef typename as_lambda_functor::type lf_t; Chris@16: typedef typename lf_t::inherited::template sig::type el_t; Chris@16: public: Chris@16: typedef Chris@16: boost::tuples::cons< Chris@16: // typename detail::remove_reference_except_from_functions::type, Chris@16: typename boost::remove_reference::type, Chris@16: typename deduce_non_ref_argument_types_::type Chris@16: > type; Chris@16: }; Chris@16: Chris@16: template Chris@16: class deduce_non_ref_argument_types_ { Chris@16: public: Chris@16: typedef null_type type; Chris@16: }; Chris@16: Chris@16: // ------------- Chris@16: Chris@16: // take stored Args and Open Args, and return a const list with Chris@16: // deduced elements (real return types) Chris@16: template Chris@16: class deduce_argument_types { Chris@16: typedef typename deduce_argument_types_::type t1; Chris@16: public: Chris@16: typedef typename detail::IF< Chris@16: has_null_type::value, null_type, t1 Chris@16: >::RET type; Chris@16: }; Chris@16: Chris@16: // take stored Args and Open Args, and return a const list with Chris@16: // deduced elements (references are stripped from the element types) Chris@16: Chris@16: template Chris@16: class deduce_non_ref_argument_types { Chris@16: typedef typename deduce_non_ref_argument_types_::type t1; Chris@16: public: Chris@16: typedef typename detail::IF< Chris@16: has_null_type::value, null_type, t1 Chris@16: >::RET type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct nth_return_type_sig { Chris@16: typedef typename Chris@16: as_lambda_functor< Chris@16: typename boost::tuples::element::type Chris@16: // typename tuple_element_as_reference::type Chris@16: >::type lf_type; Chris@16: Chris@16: typedef typename lf_type::inherited::template sig::type type; Chris@16: }; Chris@16: Chris@16: template struct element_or_null { Chris@16: typedef typename boost::tuples::element::type type; Chris@16: }; Chris@16: Chris@16: template struct element_or_null { Chris@16: typedef null_type type; Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: Chris@16: } // end detail Chris@16: Chris@16: // -- lambda_functor base --------------------- Chris@16: Chris@16: // the explicit_return_type_action case ----------------------------------- Chris@16: template Chris@16: class lambda_functor_base, Args> Chris@16: { Chris@16: public: Chris@16: Args args; Chris@16: Chris@16: typedef RET result_type; Chris@16: Chris@16: explicit lambda_functor_base(const Args& a) : args(a) {} Chris@16: Chris@16: template struct sig { typedef RET type; }; Chris@16: Chris@16: template Chris@16: RET call(CALL_FORMAL_ARGS) const Chris@16: { Chris@16: return detail::constify_rvals::go( Chris@16: detail::r_select::go(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)); Chris@16: } Chris@16: }; Chris@16: Chris@16: // the protect_action case ----------------------------------- Chris@16: template Chris@16: class lambda_functor_base Chris@16: { Chris@16: public: Chris@16: Args args; Chris@16: public: Chris@16: Chris@16: explicit lambda_functor_base(const Args& a) : args(a) {} Chris@16: Chris@16: Chris@16: template Chris@16: RET call(CALL_FORMAL_ARGS) const Chris@16: { Chris@16: CALL_USE_ARGS; Chris@16: return boost::tuples::get<0>(args); Chris@16: } Chris@16: Chris@16: template struct sig { Chris@16: // typedef typename detail::tuple_element_as_reference<0, SigArgs>::type type; Chris@16: typedef typename boost::tuples::element<0, Args>::type type; Chris@16: }; Chris@16: }; Chris@16: Chris@16: // Do nothing -------------------------------------------------------- Chris@16: class do_nothing_action {}; Chris@16: Chris@16: template Chris@16: class lambda_functor_base { Chris@16: // Args args; Chris@16: public: Chris@16: // explicit lambda_functor_base(const Args& a) {} Chris@16: lambda_functor_base() {} Chris@16: Chris@16: Chris@16: template RET call(CALL_FORMAL_ARGS) const { Chris@16: return CALL_USE_ARGS; Chris@16: } Chris@16: Chris@16: template struct sig { typedef void type; }; Chris@16: }; Chris@16: Chris@16: Chris@16: // These specializations provide a shorter notation to define actions. Chris@16: // These lambda_functor_base instances take care of the recursive evaluation Chris@16: // of the arguments and pass the evaluated arguments to the apply function Chris@16: // of an action class. To make action X work with these classes, one must Chris@16: // instantiate the lambda_functor_base as: Chris@16: // lambda_functor_base, Args> Chris@16: // Where ARITY is the arity of the apply function in X Chris@16: Chris@16: // The return type is queried as: Chris@16: // return_type_N::type Chris@16: // for which there must be a specialization. Chris@16: Chris@16: // Function actions, casts, throws,... all go via these classes. Chris@16: Chris@16: Chris@16: template Chris@16: class lambda_functor_base, Args> Chris@16: { Chris@16: public: Chris@16: // Args args; not needed Chris@16: explicit lambda_functor_base(const Args& /*a*/) {} Chris@16: Chris@16: template struct sig { Chris@16: typedef typename return_type_N::type type; Chris@16: }; Chris@16: Chris@16: template Chris@16: RET call(CALL_FORMAL_ARGS) const { Chris@16: CALL_USE_ARGS; Chris@16: return Act::template apply(); Chris@16: } Chris@16: }; Chris@16: Chris@16: Chris@16: #if defined BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART Chris@16: #error "Multiple defines of BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART" Chris@16: #endif Chris@16: Chris@16: Chris@16: #define BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(ARITY) \ Chris@16: template \ Chris@16: class lambda_functor_base, Args> \ Chris@16: { \ Chris@16: public: \ Chris@16: Args args; \ Chris@16: \ Chris@16: explicit lambda_functor_base(const Args& a) : args(a) {} \ Chris@16: \ Chris@16: template struct sig { \ Chris@16: typedef typename \ Chris@16: detail::deduce_argument_types::type rets_t; \ Chris@16: public: \ Chris@16: typedef typename \ Chris@16: return_type_N_prot::type type; \ Chris@16: }; \ Chris@16: \ Chris@16: \ Chris@16: template \ Chris@16: RET call(CALL_FORMAL_ARGS) const { \ Chris@16: using boost::tuples::get; \ Chris@16: using detail::constify_rvals; \ Chris@16: using detail::r_select; \ Chris@16: using detail::element_or_null; \ Chris@16: using detail::deduce_argument_types; Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(1) Chris@16: Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(2) Chris@16: Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: typedef typename element_or_null<1, rets_t>::type rt1; Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<1>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(3) Chris@16: Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: typedef typename element_or_null<1, rets_t>::type rt1; Chris@16: typedef typename element_or_null<2, rets_t>::type rt2; Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<1>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<2>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(4) Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: typedef typename element_or_null<1, rets_t>::type rt1; Chris@16: typedef typename element_or_null<2, rets_t>::type rt2; Chris@16: typedef typename element_or_null<3, rets_t>::type rt3; Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<1>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<2>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<3>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(5) Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: typedef typename element_or_null<1, rets_t>::type rt1; Chris@16: typedef typename element_or_null<2, rets_t>::type rt2; Chris@16: typedef typename element_or_null<3, rets_t>::type rt3; Chris@16: typedef typename element_or_null<4, rets_t>::type rt4; Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<1>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<2>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<3>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<4>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(6) Chris@16: Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: typedef typename element_or_null<1, rets_t>::type rt1; Chris@16: typedef typename element_or_null<2, rets_t>::type rt2; Chris@16: typedef typename element_or_null<3, rets_t>::type rt3; Chris@16: typedef typename element_or_null<4, rets_t>::type rt4; Chris@16: typedef typename element_or_null<5, rets_t>::type rt5; Chris@16: Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<1>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<2>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<3>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<4>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<5>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(7) Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: typedef typename element_or_null<1, rets_t>::type rt1; Chris@16: typedef typename element_or_null<2, rets_t>::type rt2; Chris@16: typedef typename element_or_null<3, rets_t>::type rt3; Chris@16: typedef typename element_or_null<4, rets_t>::type rt4; Chris@16: typedef typename element_or_null<5, rets_t>::type rt5; Chris@16: typedef typename element_or_null<6, rets_t>::type rt6; Chris@16: Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<1>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<2>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<3>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<4>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<5>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<6>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(8) Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: typedef typename element_or_null<1, rets_t>::type rt1; Chris@16: typedef typename element_or_null<2, rets_t>::type rt2; Chris@16: typedef typename element_or_null<3, rets_t>::type rt3; Chris@16: typedef typename element_or_null<4, rets_t>::type rt4; Chris@16: typedef typename element_or_null<5, rets_t>::type rt5; Chris@16: typedef typename element_or_null<6, rets_t>::type rt6; Chris@16: typedef typename element_or_null<7, rets_t>::type rt7; Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<1>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<2>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<3>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<4>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<5>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<6>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<7>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(9) Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: typedef typename element_or_null<1, rets_t>::type rt1; Chris@16: typedef typename element_or_null<2, rets_t>::type rt2; Chris@16: typedef typename element_or_null<3, rets_t>::type rt3; Chris@16: typedef typename element_or_null<4, rets_t>::type rt4; Chris@16: typedef typename element_or_null<5, rets_t>::type rt5; Chris@16: typedef typename element_or_null<6, rets_t>::type rt6; Chris@16: typedef typename element_or_null<7, rets_t>::type rt7; Chris@16: typedef typename element_or_null<8, rets_t>::type rt8; Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<1>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<2>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<3>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<4>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<5>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<6>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<7>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<8>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(10) Chris@16: typedef typename Chris@16: deduce_argument_types >::type rets_t; Chris@16: typedef typename element_or_null<0, rets_t>::type rt0; Chris@16: typedef typename element_or_null<1, rets_t>::type rt1; Chris@16: typedef typename element_or_null<2, rets_t>::type rt2; Chris@16: typedef typename element_or_null<3, rets_t>::type rt3; Chris@16: typedef typename element_or_null<4, rets_t>::type rt4; Chris@16: typedef typename element_or_null<5, rets_t>::type rt5; Chris@16: typedef typename element_or_null<6, rets_t>::type rt6; Chris@16: typedef typename element_or_null<7, rets_t>::type rt7; Chris@16: typedef typename element_or_null<8, rets_t>::type rt8; Chris@16: typedef typename element_or_null<9, rets_t>::type rt9; Chris@16: Chris@16: return Act::template apply( Chris@16: constify_rvals::go(r_select::go(get<0>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<1>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<2>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<3>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<4>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<5>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<6>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<7>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<8>(args), CALL_ACTUAL_ARGS)), Chris@16: constify_rvals::go(r_select::go(get<9>(args), CALL_ACTUAL_ARGS)) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: #undef BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART Chris@16: Chris@16: Chris@16: } // namespace lambda Chris@16: } // namespace boost Chris@16: Chris@16: #endif