First public contribution.
1 // -- Boost Lambda Library -- exceptions.hpp ----------------
3 // Copyright (C) 2000 Gary Powell (gwpowell@hotmail.com)
4 // Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
6 // Distributed under the Boost Software License, Version 1.0. (See
7 // accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
10 // For more information, see http://www.boost.org
12 // -----------------------------------------------------
14 #if !defined(BOOST_LAMBDA_EXCEPTIONS_HPP)
15 #define BOOST_LAMBDA_EXCEPTIONS_HPP
17 #include "boost/lambda/detail/control_constructs_common.hpp"
22 typedef lambda_functor<placeholder<EXCEPTION> > placeholderE_type;
25 boost::lambda::placeholderE_type freeE;
26 boost::lambda::placeholderE_type& _e = freeE;
29 // -- exception related actions -------------------
32 template <class Catch1, class Catch2 = null_type, class Catch3 = null_type,
33 class Catch4 = null_type, class Catch5 = null_type,
34 class Catch6 = null_type, class Catch7 = null_type,
35 class Catch8 = null_type, class Catch9 = null_type,
36 class Catch10 = null_type>
37 struct catch_action {};
39 struct catch_all_action {};
41 template<class CatchActions>
42 struct return_try_catch_action {};
44 template<class CatchActions>
45 struct try_catch_action {};
48 struct throw_new_action {};
49 struct rethrow_action {};
51 template<class ThrowType> struct throw_action;
54 struct throw_action<rethrow_action> {
61 template<> struct throw_action<throw_new_action> {
62 template<class RET, class T>
63 static RET apply(T& t) {
68 // return types for throw_actions --------------------------------------------
70 template<class T, class Any>
72 return_type_N<throw_action<T>, Any> {
77 // return types deductions -------------------------------------------------
79 // the return type of try_catch is the return type of the try lambda_functor
80 // (the return types of try and catch parts must match unless try returns void
81 // or the catch part throws for sure)
83 // NOTE, the exception placeholder deduction rule is defined
84 // in return_type_traits.hpp
88 // defined in control_constructs
89 class ifthenelse_action;
93 // Templates for deducing, wether a lambda_functor throws inevitably of not -
94 // This mechanism is needed to make the compiler happy about
95 // return types of try and catch parts.
97 // a lambda_functor throws for sure if:
98 // - it is a throw expression
99 // - it is a comma expression, and one of its arguments throws for sure
100 // - it is an if_then_else expression and either the if statement or both
101 // the then and else throw.
102 // (there are other cases as well, but we do not cover them)
103 // e.g. _1 + (rethrow(), 3) does throw for sure but this is not checked
104 // This implies, that in such a case, the return types of try and catch parts
105 // must match if the try part returns other than void.
106 // (Such checks could be done though)
109 struct throws_for_sure_phase2 {
110 static const bool value = false;
113 template <int N, class ThrowType, class Args>
114 struct throws_for_sure_phase2<
116 lambda_functor_base<action<N, throw_action<ThrowType> >, Args>
120 static const bool value = true;
123 // Both then and else or the if throw of an if_then_else.
124 template <class Args>
125 struct throws_for_sure_phase2<
128 ifthenelse_action, Args
133 static const bool value =
134 throws_for_sure_phase2<
135 typename boost::tuples::element<0, Args>::type>::value
138 throws_for_sure_phase2<
139 typename boost::tuples::element<1, Args>::type
142 throws_for_sure_phase2<
143 typename boost::tuples::element<2, Args>::type
148 template <class Args>
149 struct throws_for_sure_phase2<
151 lambda_functor_base< other_action<comma_action>, Args>
155 static const bool value =
156 throws_for_sure_phase2<
157 typename boost::tuples::element<0, Args>::type
160 throws_for_sure_phase2<
161 typename boost::tuples::element<1, Args>::type
165 // get rid of any qualifiers and references
166 // lambda_functors should be stored like that, so this is to be extra sure
168 struct throws_for_sure {
169 static const bool value
170 = throws_for_sure_phase2<
171 typename detail::remove_reference_and_cv<Arg>::type
176 // -- return_or_throw templates -----------------------------
178 // false case, catch and try return types are incompatible
179 // Now the catch part must throw for sure, otherwise a compile time error
181 template<bool is_conversion>
182 struct return_or_throw_phase2 {
183 template<class RET, class Arg, CALL_TEMPLATE_ARGS>
184 static RET call(Arg& arg, CALL_FORMAL_ARGS) {
185 BOOST_STATIC_ASSERT(throws_for_sure<Arg>::value);
186 detail::select(arg, CALL_ACTUAL_ARGS); // this line throws
187 throw 1; // this line is never performed, hence 1 is just a dummy
188 // The line is needed to make compiler happy and not require
189 // a matching return type
193 // the try and catch return types are compatible
195 struct return_or_throw_phase2<true> {
196 template<class RET, class Arg, CALL_TEMPLATE_ARGS>
197 static RET call(Arg& arg, CALL_FORMAL_ARGS) {
198 return detail::select(arg, CALL_ACTUAL_ARGS);
203 // the non-void case. Try part returns a value, so catch parts must
204 // return a value of the same type or throw
205 template<class RET, class ARG>
206 struct return_or_throw {
207 // Arg should be equal to ARG except that ARG may be a reference
208 // to be sure, that there are no suprises for peculiarly defined return types
209 // ARG is passed explicitely
210 template<class Arg, CALL_TEMPLATE_ARGS>
211 static RET call(Arg& arg, CALL_FORMAL_ARGS)
213 // typedef typename Arg::return_type<ARG, open_args<A&, B&, C&> >::type RT;
214 typedef typename as_lambda_functor<ARG>::type lf_type;
215 typedef typename lf_type::inherited::template
216 sig<tuple<CALL_REFERENCE_TYPES> >::type RT;
219 return_or_throw_phase2<
220 ::boost::is_convertible<RT, RET>::value
221 >::template call<RET>(arg, CALL_ACTUAL_ARGS);
225 // if try part returns void, we do not return the catch parts either
227 struct return_or_throw<void, ARG> {
228 template<class Arg, CALL_TEMPLATE_ARGS>
229 static void call(Arg& arg, CALL_FORMAL_ARGS) { detail::select(arg, CALL_ACTUAL_ARGS); }
234 // Throwing exceptions ---------------------------------------------
238 template <class T> struct catch_block {};
239 struct catch_all_block {};
241 template <class T> struct exception_catch_tag {};
243 // normal catch block is represented as
244 // tagged_lambda_functor<exception_catch_tag<catch_type<T> > >, LambdaFunctor>
246 // the default catch all block as:
247 // tagged_lambda_functor<exception_catch_tag<catch_all_block> >, LambdaFunctor>
252 // the code is RETHROW, this ensures that a compile time error results,
253 // if this lambda_functor is used outside a delayed catch_expression
257 action<0, throw_action<rethrow_action> >,
264 action<0, throw_action<rethrow_action> >,
270 template <class Arg1>
274 action<1, throw_action<throw_new_action> >,
275 tuple<typename const_copy_argument<const Arg1>::type>
278 throw_exception(const Arg1& a1) {
281 action<1, throw_action<throw_new_action> >,
282 tuple<typename const_copy_argument<const Arg1>::type>
284 ( tuple<typename const_copy_argument<const Arg1>::type>(a1));
287 // create catch blocks
288 template <class CatchType, class Arg>
290 tagged_lambda_functor<
291 detail::exception_catch_tag<detail::catch_block<CatchType> >,
294 catch_exception(const lambda_functor<Arg>& a) {
295 // the third placeholder cannot be used in catch_exception
296 // BOOST_STATIC_ASSERT((!has_placeholder<Arg, THIRD>::value));
298 tagged_lambda_functor<
299 detail::exception_catch_tag<detail::catch_block<CatchType> >,
304 // catch and do nothing case.
305 template <class CatchType>
307 tagged_lambda_functor<
308 detail::exception_catch_tag<detail::catch_block<CatchType> >,
318 tagged_lambda_functor<
319 detail::exception_catch_tag<detail::catch_block<CatchType> >,
329 // create catch(...) blocks
332 tagged_lambda_functor<
333 detail::exception_catch_tag<detail::catch_all_block>,
336 catch_all(const lambda_functor<Arg>& a) {
337 // the third placeholder cannot be used in catch_exception
338 BOOST_STATIC_ASSERT((!has_placeholder<Arg, THIRD>::value));
340 tagged_lambda_functor<
341 detail::exception_catch_tag<detail::catch_all_block>,
346 // catch(...) and do nothing case.
348 tagged_lambda_functor<
349 detail::exception_catch_tag<detail::catch_all_block>,
359 tagged_lambda_functor<
360 detail::exception_catch_tag<detail::catch_all_block>,
370 // try_catch functions --------------------------------
371 // The second -> N argument(s) are must be catch lambda_functors
372 template <class TryArg, class Catch1, class LF1>
376 action<2, try_catch_action<catch_action<Catch1> > >,
377 tuple<lambda_functor<TryArg>, LF1>
381 const lambda_functor<TryArg>& a1,
382 const tagged_lambda_functor<detail::exception_catch_tag<Catch1>, LF1>& a2)
386 action<2, try_catch_action<catch_action<Catch1> > >,
387 tuple<lambda_functor<TryArg>, LF1>
389 ( tuple< lambda_functor<TryArg>, LF1>(a1, a2));
392 template <class TryArg, class Catch1, class LF1,
393 class Catch2, class LF2>
397 action<3, try_catch_action<catch_action<detail::catch_block<Catch1>, Catch2> > >,
398 tuple<lambda_functor<TryArg>, LF1, LF2>
402 const lambda_functor<TryArg>& a1,
403 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
404 const tagged_lambda_functor<detail::exception_catch_tag<Catch2>, LF2>& a3)
408 action<3, try_catch_action<catch_action<detail::catch_block<Catch1>, Catch2> > >,
409 tuple<lambda_functor<TryArg>, LF1, LF2>
411 ( tuple<lambda_functor<TryArg>, LF1, LF2>(a1, a2, a3));
414 template <class TryArg, class Catch1, class LF1,
415 class Catch2, class LF2,
416 class Catch3, class LF3>
417 inline const lambda_functor<
419 action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, Catch3> > >,
420 tuple<lambda_functor<TryArg>, LF1, LF2, LF3>
424 const lambda_functor<TryArg>& a1,
425 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
426 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
427 const tagged_lambda_functor<detail::exception_catch_tag<Catch3>, LF3>& a4)
431 action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, Catch3> > >,
432 tuple<lambda_functor<TryArg>, LF1, LF2, LF3>
434 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3>(a1, a2, a3, a4));
437 template <class TryArg, class Catch1, class LF1,
438 class Catch2, class LF2,
439 class Catch3, class LF3,
440 class Catch4, class LF4>
447 catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, Catch4>
450 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4>
454 const lambda_functor<TryArg>& a1,
455 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
456 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
457 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
458 const tagged_lambda_functor<detail::exception_catch_tag<Catch4>, LF4>& a5)
464 try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, Catch4> >
466 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4>
468 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4>(a1, a2, a3, a4, a5));
471 template <class TryArg, class Catch1, class LF1,
472 class Catch2, class LF2,
473 class Catch3, class LF3,
474 class Catch4, class LF4,
475 class Catch5, class LF5>
481 try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, Catch5> >
483 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5>
487 const lambda_functor<TryArg>& a1,
488 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
489 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
490 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
491 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
492 const tagged_lambda_functor<detail::exception_catch_tag<Catch5>, LF5>& a6)
499 catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, Catch5>
502 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5>
504 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5>
505 (a1, a2, a3, a4, a5, a6)
509 template <class TryArg, class Catch1, class LF1,
510 class Catch2, class LF2,
511 class Catch3, class LF3,
512 class Catch4, class LF4,
513 class Catch5, class LF5,
514 class Catch6, class LF6>
521 catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, Catch6>
524 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6>
528 const lambda_functor<TryArg>& a1,
529 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
530 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
531 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
532 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
533 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
534 const tagged_lambda_functor<detail::exception_catch_tag<Catch6>, LF6>& a7)
541 catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>,Catch6>
544 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6>
546 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6>
547 (a1, a2, a3, a4, a5, a6, a7));
550 template <class TryArg, class Catch1, class LF1,
551 class Catch2, class LF2,
552 class Catch3, class LF3,
553 class Catch4, class LF4,
554 class Catch5, class LF5,
555 class Catch6, class LF6,
556 class Catch7, class LF7>
563 catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>, Catch7>
566 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7>
570 const lambda_functor<TryArg>& a1,
571 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
572 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
573 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
574 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
575 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
576 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch6> >, LF6>& a7,
577 const tagged_lambda_functor<detail::exception_catch_tag<Catch7>, LF7>& a8)
585 detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>, Catch7
589 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7>
591 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7>
592 (a1, a2, a3, a4, a5, a6, a7, a8));
595 template <class TryArg, class Catch1, class LF1,
596 class Catch2, class LF2,
597 class Catch3, class LF3,
598 class Catch4, class LF4,
599 class Catch5, class LF5,
600 class Catch6, class LF6,
601 class Catch7, class LF7,
602 class Catch8, class LF8>
610 detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>, detail::catch_block<Catch7>, Catch8
614 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8>
618 const lambda_functor<TryArg>& a1,
619 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
620 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
621 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
622 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
623 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
624 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch6> >, LF6>& a7,
625 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch7> >, LF7>& a8,
626 const tagged_lambda_functor<detail::exception_catch_tag<Catch8>, LF8>& a9)
634 detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>, detail::catch_block<Catch7>, Catch8
638 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8>
640 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8>
641 (a1, a2, a3, a4, a5, a6, a7, a8, a9));
644 template <class TryArg, class Catch1, class LF1,
645 class Catch2, class LF2,
646 class Catch3, class LF3,
647 class Catch4, class LF4,
648 class Catch5, class LF5,
649 class Catch6, class LF6,
650 class Catch7, class LF7,
651 class Catch8, class LF8,
652 class Catch9, class LF9>
660 detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>, detail::catch_block<Catch7>, detail::catch_block<Catch8>,
666 lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9
671 const lambda_functor<TryArg>& a1,
672 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
673 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
674 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
675 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
676 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
677 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch6> >, LF6>& a7,
678 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch7> >, LF7>& a8,
679 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch8> >, LF8>& a9,
680 const tagged_lambda_functor<detail::exception_catch_tag<Catch9>, LF9>& a10)
688 detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>, detail::catch_block<Catch7>, detail::catch_block<Catch8>,
694 lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9
698 lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9
699 >(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10));
703 // ---------------------------------------------------------------------------
704 // Specializations for lambda_functor_base of try_catch ----------------------
708 template<class Args, class Catch1>
709 class lambda_functor_base<
710 action<2, try_catch_action<catch_action<detail::catch_block<Catch1> > > >,
717 explicit lambda_functor_base(const Args& a) : args(a) {}
719 // the return type of try_catch is the return type of the try lambda_functor
720 // (the return types of try and catch parts must match unless try returns void
721 // or the catch part throws for sure)
723 template <class SigArgs> struct sig {
726 typename boost::tuples::element<0, Args>::type
729 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
732 template<class RET, CALL_TEMPLATE_ARGS>
733 RET call(CALL_FORMAL_ARGS) const {
736 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
741 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
742 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
750 class lambda_functor_base<action<2, try_catch_action<catch_action<detail::catch_all_block> > >, Args> {
754 explicit lambda_functor_base(const Args& a) : args(a) {}
756 template <class SigArgs> struct sig {
759 typename boost::tuples::element<0, Args>::type
762 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
765 template<class RET, CALL_TEMPLATE_ARGS>
766 RET call(CALL_FORMAL_ARGS) const {
769 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
774 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
775 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS);
781 // 2 catch types case
782 template<class Args, class Catch1, class Catch2>
783 class lambda_functor_base<action<3, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2> > > >, Args> {
787 explicit lambda_functor_base(const Args& a) : args(a) {}
789 template <class SigArgs> struct sig {
792 typename boost::tuples::element<0, Args>::type
795 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
798 template<class RET, CALL_TEMPLATE_ARGS>
799 RET call(CALL_FORMAL_ARGS) const {
802 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
807 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
808 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
813 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
814 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
819 template<class Args, class Catch1>
820 class lambda_functor_base<action<3, try_catch_action<catch_action<detail::catch_block<Catch1>,detail::catch_all_block> > >, Args> {
824 explicit lambda_functor_base(const Args& a) : args(a) {}
826 template <class SigArgs> struct sig {
829 typename boost::tuples::element<0, Args>::type
832 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
835 template<class RET, CALL_TEMPLATE_ARGS>
836 RET call(CALL_FORMAL_ARGS) const {
839 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
844 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
845 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
850 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
851 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS);
856 // 3 catch types case
857 template<class Args, class Catch1, class Catch2, class Catch3>
858 class lambda_functor_base<action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3> > > >, Args> {
862 explicit lambda_functor_base(const Args& a) : args(a) {}
864 template <class SigArgs> struct sig {
867 typename boost::tuples::element<0, Args>::type
870 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
873 template<class RET, CALL_TEMPLATE_ARGS>
874 RET call(CALL_FORMAL_ARGS) const {
877 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
882 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
883 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
889 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
890 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
896 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
897 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
902 template<class Args, class Catch1, class Catch2>
903 class lambda_functor_base<action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>,detail::catch_all_block> > >, Args> {
907 explicit lambda_functor_base(const Args& a) : args(a) {}
909 template <class SigArgs> struct sig {
912 typename boost::tuples::element<0, Args>::type
915 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
918 template<class RET, CALL_TEMPLATE_ARGS>
919 RET call(CALL_FORMAL_ARGS) const {
922 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
927 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
928 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
933 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
934 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
939 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
940 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS);
945 // 4 catch types case
946 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4>
947 class lambda_functor_base<action<5, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4> > > >, Args> {
951 explicit lambda_functor_base(const Args& a) : args(a) {}
953 template <class SigArgs> struct sig {
956 typename boost::tuples::element<0, Args>::type
959 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
962 template<class RET, CALL_TEMPLATE_ARGS>
963 RET call(CALL_FORMAL_ARGS) const {
966 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
971 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
972 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
977 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
978 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
983 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
984 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
989 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
990 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
995 template<class Args, class Catch1, class Catch2, class Catch3>
996 class lambda_functor_base<action<5, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>,detail::catch_all_block> > >, Args> {
1000 explicit lambda_functor_base(const Args& a) : args(a) {}
1002 template <class SigArgs> struct sig {
1005 typename boost::tuples::element<0, Args>::type
1008 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1011 template<class RET, CALL_TEMPLATE_ARGS>
1012 RET call(CALL_FORMAL_ARGS) const {
1015 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1020 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1021 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1026 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1027 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1032 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1033 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1038 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1039 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS);
1044 // 5 catch types case
1045 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5>
1046 class lambda_functor_base<action<6, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5> > > >, Args> {
1050 explicit lambda_functor_base(const Args& a) : args(a) {}
1052 template <class SigArgs> struct sig {
1055 typename boost::tuples::element<0, Args>::type
1058 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1061 template<class RET, CALL_TEMPLATE_ARGS>
1062 RET call(CALL_FORMAL_ARGS) const {
1065 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1070 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1071 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1076 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1077 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1082 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1083 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1088 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1089 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1094 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1095 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1100 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4>
1101 class lambda_functor_base<action<6, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>,detail::catch_all_block> > >, Args> {
1105 explicit lambda_functor_base(const Args& a) : args(a) {}
1107 template <class SigArgs> struct sig {
1110 typename boost::tuples::element<0, Args>::type
1113 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1116 template<class RET, CALL_TEMPLATE_ARGS>
1117 RET call(CALL_FORMAL_ARGS) const {
1120 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1125 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1126 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1131 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1132 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1137 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1138 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1143 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1144 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1149 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1150 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS);
1155 // 6 catch types case
1156 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6>
1157 class lambda_functor_base<action<7, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6> > > >, Args> {
1161 explicit lambda_functor_base(const Args& a) : args(a) {}
1163 template <class SigArgs> struct sig {
1166 typename boost::tuples::element<0, Args>::type
1169 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1172 template<class RET, CALL_TEMPLATE_ARGS>
1173 RET call(CALL_FORMAL_ARGS) const {
1176 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1181 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1182 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1187 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1188 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1193 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1194 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1199 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1200 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1205 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1206 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1211 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1212 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1217 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5>
1218 class lambda_functor_base<action<7, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>,detail::catch_all_block> > >, Args> {
1222 explicit lambda_functor_base(const Args& a) : args(a) {}
1224 template <class SigArgs> struct sig {
1227 typename boost::tuples::element<0, Args>::type
1230 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1233 template<class RET, CALL_TEMPLATE_ARGS>
1234 RET call(CALL_FORMAL_ARGS) const {
1237 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1242 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1243 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1248 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1249 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1254 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1255 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1260 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1261 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1266 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1267 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1272 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1273 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS);
1278 // 7 catch types case
1279 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1281 class lambda_functor_base<action<8, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>, detail::catch_block<Catch7> > > >, Args> {
1285 explicit lambda_functor_base(const Args& a) : args(a) {}
1287 template <class SigArgs> struct sig {
1290 typename boost::tuples::element<0, Args>::type
1293 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1296 template<class RET, CALL_TEMPLATE_ARGS>
1297 RET call(CALL_FORMAL_ARGS) const {
1300 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1305 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1306 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1311 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1312 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1317 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1318 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1323 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1324 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1329 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1330 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1335 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1336 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1341 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1342 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1347 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6>
1348 class lambda_functor_base<action<8, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>,
1349 detail::catch_all_block> > >, Args> {
1353 explicit lambda_functor_base(const Args& a) : args(a) {}
1355 template <class SigArgs> struct sig {
1358 typename boost::tuples::element<0, Args>::type
1361 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1364 template<class RET, CALL_TEMPLATE_ARGS>
1365 RET call(CALL_FORMAL_ARGS) const {
1368 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1373 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1374 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1379 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1380 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1385 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1386 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1391 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1392 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1397 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1398 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1403 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1404 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1409 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1410 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS);
1415 // 8 catch types case
1416 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1417 class Catch7, class Catch8>
1418 class lambda_functor_base<action<9, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>,
1419 detail::catch_block<Catch7>, detail::catch_block<Catch8> > > >, Args> {
1423 explicit lambda_functor_base(const Args& a) : args(a) {}
1425 template <class SigArgs> struct sig {
1428 typename boost::tuples::element<0, Args>::type
1431 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1434 template<class RET, CALL_TEMPLATE_ARGS>
1435 RET call(CALL_FORMAL_ARGS) const {
1438 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1443 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1444 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1449 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1450 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1455 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1456 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1461 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1462 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1467 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1468 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1473 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1474 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1479 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1480 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1485 detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
1486 ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1491 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1493 class lambda_functor_base<action<9, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>,
1494 detail::catch_block<Catch7>,detail::catch_all_block> > >, Args> {
1498 explicit lambda_functor_base(const Args& a) : args(a) {}
1500 template <class SigArgs> struct sig {
1503 typename boost::tuples::element<0, Args>::type
1506 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1509 template<class RET, CALL_TEMPLATE_ARGS>
1510 RET call(CALL_FORMAL_ARGS) const {
1513 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1518 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1519 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1524 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1525 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1530 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1531 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1536 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1537 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1542 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1543 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1548 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1549 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1554 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1555 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1560 detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
1561 ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS);
1566 // 9 catch types case
1567 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1568 class Catch7, class Catch8, class Catch9>
1569 class lambda_functor_base<action<10, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>,
1570 detail::catch_block<Catch7>, detail::catch_block<Catch8>, detail::catch_block<Catch9> > > >, Args> {
1574 explicit lambda_functor_base(const Args& a) : args(a) {}
1576 template <class SigArgs> struct sig {
1579 typename boost::tuples::element<0, Args>::type
1582 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1585 template<class RET, CALL_TEMPLATE_ARGS>
1586 RET call(CALL_FORMAL_ARGS) const {
1589 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1594 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1595 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1600 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1601 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1606 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1607 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1612 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1613 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1618 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1619 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1624 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1625 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1630 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1631 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1636 detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
1637 ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1642 detail::return_or_throw<RET, typename ::boost::tuples::element<9, Args>::type>
1643 ::call(::boost::tuples::get<9>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1648 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1649 class Catch7, class Catch8>
1650 class lambda_functor_base<action<10, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, detail::catch_block<Catch6>,
1651 detail::catch_block<Catch7>, detail::catch_block<Catch8>,detail::catch_all_block> > >, Args> {
1655 explicit lambda_functor_base(const Args& a) : args(a) {}
1657 template <class SigArgs> struct sig {
1660 typename boost::tuples::element<0, Args>::type
1663 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1666 template<class RET, CALL_TEMPLATE_ARGS>
1667 RET call(CALL_FORMAL_ARGS) const {
1670 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1675 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1676 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1681 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1682 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1687 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1688 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1693 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1694 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1699 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1700 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1705 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1706 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1711 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1712 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1717 detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
1718 ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1723 detail::return_or_throw<RET, typename ::boost::tuples::element<9, Args>::type>
1724 ::call(::boost::tuples::get<9>(args), CALL_ACTUAL_ARGS);
1730 } // namespace lambda
1731 } // namespace boost