Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:07

0001 // Boost Lambda Library  lambda_functor_base.hpp -----------------------------
0002 //
0003 // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
0004 //
0005 // Distributed under the Boost Software License, Version 1.0. (See
0006 // accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // For more information, see www.boost.org
0010 
0011 // ------------------------------------------------------------
0012 
0013 #ifndef BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_HPP
0014 #define BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_HPP
0015 
0016 #include "boost/type_traits/add_reference.hpp"
0017 #include "boost/type_traits/add_const.hpp"
0018 #include "boost/type_traits/remove_const.hpp"
0019 #include "boost/lambda/detail/lambda_fwd.hpp"
0020 #include "boost/lambda/detail/lambda_traits.hpp"
0021 
0022 namespace boost { 
0023 namespace lambda {
0024 
0025 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
0026 #pragma warning(push)
0027 #pragma warning(disable:4512) //assignment operator could not be generated
0028 #endif
0029 
0030   // for return type deductions we wrap bound argument to this class,
0031   // which fulfils the base class contract for lambda_functors
0032 template <class T>
0033 class identity {
0034 
0035   T elem;
0036 public:
0037   
0038   typedef T element_t;
0039 
0040   // take all parameters as const references. Note that non-const references
0041   // stay as they are.
0042   typedef typename boost::add_reference<
0043     typename boost::add_const<T>::type
0044   >::type par_t;
0045 
0046   explicit identity(par_t t) : elem(t) {}
0047 
0048   template <typename SigArgs> 
0049   struct sig { typedef typename boost::remove_const<element_t>::type type; };
0050 
0051   template<class RET, CALL_TEMPLATE_ARGS>
0052   RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return elem; }
0053 };
0054 
0055 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
0056 #pragma warning(pop)
0057 #endif
0058 
0059 template <class T> 
0060 inline lambda_functor<identity<T&> > var(T& t) { return identity<T&>(t); }
0061 
0062   // for lambda functors, var is an identity operator. It was forbidden
0063   // at some point, but we might want to var something that can be a 
0064   // non-lambda functor or a lambda functor.
0065 template <class T>
0066 lambda_functor<T> var(const lambda_functor<T>& t) { return t; }
0067 
0068 template <class T> struct var_type {
0069   typedef lambda_functor<identity<T&> > type;
0070 };
0071 
0072 
0073 template <class T> 
0074 inline 
0075 lambda_functor<identity<typename bound_argument_conversion<const T>::type> >
0076 constant(const T& t) { 
0077   return identity<typename bound_argument_conversion<const T>::type>(t); 
0078 }
0079 template <class T>
0080 lambda_functor<T> constant(const lambda_functor<T>& t) { return t; }
0081 
0082 template <class T> struct constant_type {
0083   typedef 
0084    lambda_functor<
0085      identity<typename bound_argument_conversion<const T>::type> 
0086    > type;
0087 };
0088 
0089 
0090 
0091 template <class T> 
0092 inline lambda_functor<identity<const T&> > constant_ref(const T& t) { 
0093   return identity<const T&>(t); 
0094 }
0095 template <class T>
0096 lambda_functor<T> constant_ref(const lambda_functor<T>& t) { return t; }
0097 
0098 template <class T> struct constant_ref_type {
0099   typedef 
0100    lambda_functor<identity<const T&> > type;
0101 };
0102 
0103 
0104 
0105   // as_lambda_functor turns any types to lambda functors 
0106   // non-lambda_functors will be bound argument types
0107 template <class T>
0108 struct as_lambda_functor { 
0109   typedef typename 
0110     detail::remove_reference_and_cv<T>::type plain_T;
0111   typedef typename 
0112     detail::IF<is_lambda_functor<plain_T>::value, 
0113       plain_T,
0114       lambda_functor<
0115         identity<typename bound_argument_conversion<T>::type> 
0116       >
0117     >::RET type; 
0118 };
0119 
0120 // turns arbitrary objects into lambda functors
0121 template <class T> 
0122 inline 
0123 lambda_functor<identity<typename bound_argument_conversion<const T>::type> > 
0124 to_lambda_functor(const T& t) { 
0125   return identity<typename bound_argument_conversion<const T>::type>(t);
0126 }
0127 
0128 template <class T> 
0129 inline lambda_functor<T> 
0130 to_lambda_functor(const lambda_functor<T>& t) { 
0131   return t;
0132 }
0133 
0134 namespace detail {   
0135 
0136 
0137 
0138 // In a call constify_rvals<T>::go(x)
0139 // x should be of type T. If T is a non-reference type, do
0140 // returns x as const reference. 
0141 // Otherwise the type doesn't change.
0142 // The purpose of this class is to avoid 
0143 // 'cannot bind temporaries to non-const references' errors.
0144 template <class T> struct constify_rvals {
0145   template<class U>
0146   static inline const U& go(const U& u) { return u; }
0147 };
0148 
0149 template <class T> struct constify_rvals<T&> {
0150   template<class U>
0151   static inline U& go(U& u) { return u; }
0152 };
0153 
0154   // check whether one of the elements of a tuple (cons list) is of type
0155   // null_type. Needed, because the compiler goes ahead and instantiates
0156   // sig template for nullary case even if the nullary operator() is not
0157   // called
0158 template <class T> struct is_null_type 
0159 { BOOST_STATIC_CONSTANT(bool, value = false); };
0160 
0161 template <> struct is_null_type<null_type> 
0162 { BOOST_STATIC_CONSTANT(bool, value = true); };
0163 
0164 template<class Tuple> struct has_null_type {
0165   BOOST_STATIC_CONSTANT(bool, value = (is_null_type<typename Tuple::head_type>::value || has_null_type<typename Tuple::tail_type>::value));
0166 };
0167 template<> struct has_null_type<null_type> {
0168   BOOST_STATIC_CONSTANT(bool, value = false);
0169 };
0170 
0171 
0172 // helpers -------------------
0173 
0174 
0175 template<class Args, class SigArgs>
0176 class deduce_argument_types_ {
0177   typedef typename as_lambda_functor<typename Args::head_type>::type lf_t;
0178   typedef typename lf_t::inherited::template sig<SigArgs>::type el_t;  
0179 public:
0180   typedef
0181     boost::tuples::cons<
0182       el_t, 
0183       typename deduce_argument_types_<typename Args::tail_type, SigArgs>::type
0184     > type;
0185 };
0186 
0187 template<class SigArgs>
0188 class deduce_argument_types_<null_type, SigArgs> {
0189 public:
0190   typedef null_type type; 
0191 };
0192 
0193 
0194 //  // note that tuples cannot have plain function types as elements.
0195 //  // Hence, all other types will be non-const, except references to 
0196 //  // functions.
0197 //  template <class T> struct remove_reference_except_from_functions {
0198 //    typedef typename boost::remove_reference<T>::type t;
0199 //    typedef typename detail::IF<boost::is_function<t>::value, T, t>::RET type;
0200 //  };
0201 
0202 template<class Args, class SigArgs>
0203 class deduce_non_ref_argument_types_ {
0204   typedef typename as_lambda_functor<typename Args::head_type>::type lf_t;
0205   typedef typename lf_t::inherited::template sig<SigArgs>::type el_t;  
0206 public:
0207   typedef
0208     boost::tuples::cons<
0209   //      typename detail::remove_reference_except_from_functions<el_t>::type, 
0210       typename boost::remove_reference<el_t>::type, 
0211       typename deduce_non_ref_argument_types_<typename Args::tail_type, SigArgs>::type
0212     > type;
0213 };
0214 
0215 template<class SigArgs>
0216 class deduce_non_ref_argument_types_<null_type, SigArgs> {
0217 public:
0218   typedef null_type type; 
0219 };
0220 
0221   // -------------
0222 
0223 // take stored Args and Open Args, and return a const list with 
0224 // deduced elements (real return types)
0225 template<class Args, class SigArgs>
0226 class deduce_argument_types {
0227   typedef typename deduce_argument_types_<Args, SigArgs>::type t1;
0228 public:
0229   typedef typename detail::IF<
0230     has_null_type<t1>::value, null_type, t1
0231   >::RET type; 
0232 };
0233 
0234 // take stored Args and Open Args, and return a const list with 
0235 // deduced elements (references are stripped from the element types)
0236 
0237 template<class Args, class SigArgs>
0238 class deduce_non_ref_argument_types {
0239   typedef typename deduce_non_ref_argument_types_<Args, SigArgs>::type t1;
0240 public:
0241   typedef typename detail::IF<
0242     has_null_type<t1>::value, null_type, t1
0243   >::RET type; 
0244 };
0245 
0246 template <int N, class Args, class SigArgs>
0247 struct nth_return_type_sig {
0248   typedef typename 
0249           as_lambda_functor<
0250             typename boost::tuples::element<N, Args>::type 
0251   //            typename tuple_element_as_reference<N, Args>::type 
0252         >::type lf_type;
0253 
0254   typedef typename lf_type::inherited::template sig<SigArgs>::type type;  
0255 };
0256 
0257 template<int N, class Tuple> struct element_or_null {
0258   typedef typename boost::tuples::element<N, Tuple>::type type;
0259 };
0260 
0261 template<int N> struct element_or_null<N, null_type> {
0262   typedef null_type type;
0263 };
0264 
0265 
0266    
0267    
0268 } // end detail
0269    
0270  // -- lambda_functor base ---------------------
0271 
0272 // the explicit_return_type_action case -----------------------------------
0273 template<class RET, class Args>
0274 class lambda_functor_base<explicit_return_type_action<RET>, Args> 
0275 {
0276 public:
0277   Args args;
0278 
0279   typedef RET result_type;
0280 
0281   explicit lambda_functor_base(const Args& a) : args(a) {}
0282 
0283   template <class SigArgs> struct sig { typedef RET type; };
0284 
0285   template<class RET_, CALL_TEMPLATE_ARGS>
0286   RET call(CALL_FORMAL_ARGS) const 
0287   {
0288     return detail::constify_rvals<RET>::go(
0289      detail::r_select<RET>::go(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS));
0290   }
0291 };
0292 
0293 // the protect_action case -----------------------------------
0294 template<class Args>
0295 class lambda_functor_base<protect_action, Args>
0296 {
0297 public:
0298   Args args;
0299 public:
0300 
0301   explicit lambda_functor_base(const Args& a) : args(a) {}
0302 
0303 
0304   template<class RET, CALL_TEMPLATE_ARGS>
0305   RET call(CALL_FORMAL_ARGS) const 
0306   {
0307      CALL_USE_ARGS;
0308      return boost::tuples::get<0>(args);
0309   }
0310 
0311   template<class SigArgs> struct sig { 
0312     //    typedef typename detail::tuple_element_as_reference<0, SigArgs>::type type;
0313     typedef typename boost::tuples::element<0, Args>::type type;
0314   };
0315 };
0316 
0317 // Do nothing --------------------------------------------------------
0318 class do_nothing_action {};
0319 
0320 template<class Args>
0321 class lambda_functor_base<do_nothing_action, Args> {
0322   //  Args args;
0323 public:
0324   //  explicit lambda_functor_base(const Args& a) {}
0325   lambda_functor_base() {}
0326 
0327 
0328   template<class RET, CALL_TEMPLATE_ARGS> RET call(CALL_FORMAL_ARGS) const {
0329     return CALL_USE_ARGS;
0330   }
0331 
0332   template<class SigArgs> struct sig { typedef void type; };
0333 };  
0334 
0335 
0336 //  These specializations provide a shorter notation to define actions.
0337 //  These lambda_functor_base instances take care of the recursive evaluation
0338 //  of the arguments and pass the evaluated arguments to the apply function
0339 //  of an action class. To make action X work with these classes, one must
0340 //  instantiate the lambda_functor_base as:
0341 //  lambda_functor_base<action<ARITY, X>, Args>
0342 //  Where ARITY is the arity of the apply function in X
0343 
0344 //  The return type is queried as:
0345 //  return_type_N<X, EvaluatedArgumentTypes>::type
0346 //  for which there must be a specialization.
0347 
0348 //  Function actions, casts, throws,... all go via these classes.
0349 
0350 
0351 template<class Act, class Args>  
0352 class lambda_functor_base<action<0, Act>, Args>           
0353 {  
0354 public:  
0355 //  Args args; not needed
0356   explicit lambda_functor_base(const Args& /*a*/) {}  
0357   
0358   template<class SigArgs> struct sig {  
0359     typedef typename return_type_N<Act, null_type>::type type;
0360   };
0361   
0362   template<class RET, CALL_TEMPLATE_ARGS>  
0363   RET call(CALL_FORMAL_ARGS) const {  
0364     CALL_USE_ARGS;
0365     return Act::template apply<RET>();
0366   }
0367 };
0368 
0369 
0370 #if defined BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART  
0371 #error "Multiple defines of BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART"  
0372 #endif  
0373   
0374   
0375 #define BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(ARITY)             \
0376 template<class Act, class Args>                                        \
0377 class lambda_functor_base<action<ARITY, Act>, Args>                    \
0378 {                                                                      \
0379 public:                                                                \
0380   Args args;                                                           \
0381                                                                        \
0382   explicit lambda_functor_base(const Args& a) : args(a) {}             \
0383                                                                        \
0384   template<class SigArgs> struct sig {                                 \
0385     typedef typename                                                   \
0386     detail::deduce_argument_types<Args, SigArgs>::type rets_t;         \
0387   public:                                                              \
0388     typedef typename                                                   \
0389       return_type_N_prot<Act, rets_t>::type type;                      \
0390   };                                                                   \
0391                                                                        \
0392                                                                        \
0393   template<class RET, CALL_TEMPLATE_ARGS>                              \
0394   RET call(CALL_FORMAL_ARGS) const {                                   \
0395     using boost::tuples::get;                                          \
0396     using detail::constify_rvals;                                      \
0397     using detail::r_select;                                            \
0398     using detail::element_or_null;                                     \
0399     using detail::deduce_argument_types;                                
0400 
0401 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(1)
0402 
0403   typedef typename
0404     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0405   typedef typename element_or_null<0, rets_t>::type rt0;
0406 
0407   return Act::template apply<RET>(
0408     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS))
0409     );
0410   }
0411 };
0412 
0413 
0414 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(2)
0415   
0416   typedef typename 
0417     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0418   typedef typename element_or_null<0, rets_t>::type rt0;
0419   typedef typename element_or_null<1, rets_t>::type rt1;
0420 
0421   return Act::template apply<RET>(
0422     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
0423     constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS))
0424     );
0425   }
0426 };
0427 
0428 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(3)
0429 
0430   typedef typename 
0431     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0432 
0433   typedef typename element_or_null<0, rets_t>::type rt0;
0434   typedef typename element_or_null<1, rets_t>::type rt1;
0435   typedef typename element_or_null<2, rets_t>::type rt2;
0436 
0437   return Act::template apply<RET>(
0438     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
0439     constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
0440     constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS))
0441     );
0442   }
0443 };
0444 
0445 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(4)
0446   typedef typename 
0447     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0448   typedef typename element_or_null<0, rets_t>::type rt0;
0449   typedef typename element_or_null<1, rets_t>::type rt1;
0450   typedef typename element_or_null<2, rets_t>::type rt2;
0451   typedef typename element_or_null<3, rets_t>::type rt3;
0452 
0453   return Act::template apply<RET>(
0454     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
0455     constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
0456     constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
0457     constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS))
0458     );
0459   }
0460 };
0461 
0462 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(5)
0463   typedef typename 
0464     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0465   typedef typename element_or_null<0, rets_t>::type rt0;
0466   typedef typename element_or_null<1, rets_t>::type rt1;
0467   typedef typename element_or_null<2, rets_t>::type rt2;
0468   typedef typename element_or_null<3, rets_t>::type rt3;
0469   typedef typename element_or_null<4, rets_t>::type rt4;
0470 
0471   return Act::template apply<RET>(
0472     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
0473     constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
0474     constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
0475     constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
0476     constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS))
0477     );
0478   }
0479 };
0480 
0481 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(6)
0482 
0483   typedef typename 
0484     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0485   typedef typename element_or_null<0, rets_t>::type rt0;
0486   typedef typename element_or_null<1, rets_t>::type rt1;
0487   typedef typename element_or_null<2, rets_t>::type rt2;
0488   typedef typename element_or_null<3, rets_t>::type rt3;
0489   typedef typename element_or_null<4, rets_t>::type rt4;
0490   typedef typename element_or_null<5, rets_t>::type rt5;
0491 
0492 
0493     return Act::template apply<RET>(
0494     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
0495     constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
0496     constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
0497     constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
0498     constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
0499     constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS)) 
0500     );
0501   }
0502 };
0503 
0504 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(7)
0505   typedef typename 
0506     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0507   typedef typename element_or_null<0, rets_t>::type rt0;
0508   typedef typename element_or_null<1, rets_t>::type rt1;
0509   typedef typename element_or_null<2, rets_t>::type rt2;
0510   typedef typename element_or_null<3, rets_t>::type rt3;
0511   typedef typename element_or_null<4, rets_t>::type rt4;
0512   typedef typename element_or_null<5, rets_t>::type rt5;
0513   typedef typename element_or_null<6, rets_t>::type rt6;
0514 
0515 
0516   return Act::template apply<RET>(
0517     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
0518     constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
0519     constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
0520     constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
0521     constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
0522     constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS)),
0523     constify_rvals<rt6>::go(r_select<rt6>::go(get<6>(args), CALL_ACTUAL_ARGS))
0524     );
0525   }
0526 };
0527 
0528 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(8)
0529   typedef typename 
0530     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0531   typedef typename element_or_null<0, rets_t>::type rt0;
0532   typedef typename element_or_null<1, rets_t>::type rt1;
0533   typedef typename element_or_null<2, rets_t>::type rt2;
0534   typedef typename element_or_null<3, rets_t>::type rt3;
0535   typedef typename element_or_null<4, rets_t>::type rt4;
0536   typedef typename element_or_null<5, rets_t>::type rt5;
0537   typedef typename element_or_null<6, rets_t>::type rt6;
0538   typedef typename element_or_null<7, rets_t>::type rt7;
0539 
0540   return Act::template apply<RET>(
0541     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
0542     constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
0543     constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
0544     constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
0545     constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
0546     constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS)),
0547     constify_rvals<rt6>::go(r_select<rt6>::go(get<6>(args), CALL_ACTUAL_ARGS)),
0548     constify_rvals<rt7>::go(r_select<rt7>::go(get<7>(args), CALL_ACTUAL_ARGS))
0549     );
0550   }
0551 };
0552 
0553 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(9)
0554   typedef typename 
0555     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0556   typedef typename element_or_null<0, rets_t>::type rt0;
0557   typedef typename element_or_null<1, rets_t>::type rt1;
0558   typedef typename element_or_null<2, rets_t>::type rt2;
0559   typedef typename element_or_null<3, rets_t>::type rt3;
0560   typedef typename element_or_null<4, rets_t>::type rt4;
0561   typedef typename element_or_null<5, rets_t>::type rt5;
0562   typedef typename element_or_null<6, rets_t>::type rt6;
0563   typedef typename element_or_null<7, rets_t>::type rt7;
0564   typedef typename element_or_null<8, rets_t>::type rt8;
0565 
0566   return Act::template apply<RET>(
0567     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
0568     constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
0569     constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
0570     constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
0571     constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
0572     constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS)),
0573     constify_rvals<rt6>::go(r_select<rt6>::go(get<6>(args), CALL_ACTUAL_ARGS)),
0574     constify_rvals<rt7>::go(r_select<rt7>::go(get<7>(args), CALL_ACTUAL_ARGS)),
0575     constify_rvals<rt8>::go(r_select<rt8>::go(get<8>(args), CALL_ACTUAL_ARGS))
0576     );
0577   }
0578 };
0579 
0580 BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(10) 
0581   typedef typename 
0582     deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
0583   typedef typename element_or_null<0, rets_t>::type rt0;
0584   typedef typename element_or_null<1, rets_t>::type rt1;
0585   typedef typename element_or_null<2, rets_t>::type rt2;
0586   typedef typename element_or_null<3, rets_t>::type rt3;
0587   typedef typename element_or_null<4, rets_t>::type rt4;
0588   typedef typename element_or_null<5, rets_t>::type rt5;
0589   typedef typename element_or_null<6, rets_t>::type rt6;
0590   typedef typename element_or_null<7, rets_t>::type rt7;
0591   typedef typename element_or_null<8, rets_t>::type rt8;
0592   typedef typename element_or_null<9, rets_t>::type rt9;
0593 
0594   return Act::template apply<RET>(
0595     constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
0596     constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
0597     constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
0598     constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
0599     constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
0600     constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS)),
0601     constify_rvals<rt6>::go(r_select<rt6>::go(get<6>(args), CALL_ACTUAL_ARGS)),
0602     constify_rvals<rt7>::go(r_select<rt7>::go(get<7>(args), CALL_ACTUAL_ARGS)),
0603     constify_rvals<rt8>::go(r_select<rt8>::go(get<8>(args), CALL_ACTUAL_ARGS)),
0604     constify_rvals<rt9>::go(r_select<rt9>::go(get<9>(args), CALL_ACTUAL_ARGS)) 
0605     );
0606   }
0607 };
0608 
0609 #undef BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART
0610 
0611 
0612 } // namespace lambda
0613 } // namespace boost
0614 
0615 #endif