sl@0: // -- Boost Lambda Library -- exceptions.hpp ---------------- sl@0: // sl@0: // Copyright (C) 2000 Gary Powell (gwpowell@hotmail.com) sl@0: // Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) sl@0: // sl@0: // Distributed under the Boost Software License, Version 1.0. (See sl@0: // accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: // sl@0: // For more information, see http://www.boost.org sl@0: sl@0: // ----------------------------------------------------- sl@0: sl@0: #if !defined(BOOST_LAMBDA_EXCEPTIONS_HPP) sl@0: #define BOOST_LAMBDA_EXCEPTIONS_HPP sl@0: sl@0: #include "boost/lambda/detail/control_constructs_common.hpp" sl@0: sl@0: namespace boost { sl@0: namespace lambda { sl@0: sl@0: typedef lambda_functor > placeholderE_type; sl@0: sl@0: namespace { sl@0: boost::lambda::placeholderE_type freeE; sl@0: boost::lambda::placeholderE_type& _e = freeE; sl@0: } sl@0: sl@0: // -- exception related actions ------------------- sl@0: sl@0: // catch actions. sl@0: template sl@0: struct catch_action {}; sl@0: sl@0: struct catch_all_action {}; sl@0: sl@0: template sl@0: struct return_try_catch_action {}; sl@0: sl@0: template sl@0: struct try_catch_action {}; sl@0: sl@0: // rethrow actions sl@0: struct throw_new_action {}; sl@0: struct rethrow_action {}; sl@0: sl@0: template struct throw_action; sl@0: sl@0: template<> sl@0: struct throw_action { sl@0: template sl@0: static RET apply() { sl@0: throw; sl@0: } sl@0: }; sl@0: sl@0: template<> struct throw_action { sl@0: template sl@0: static RET apply(T& t) { sl@0: throw t; sl@0: } sl@0: }; sl@0: sl@0: // return types for throw_actions -------------------------------------------- sl@0: sl@0: template sl@0: struct sl@0: return_type_N, Any> { sl@0: typedef void type; sl@0: }; sl@0: sl@0: sl@0: // return types deductions ------------------------------------------------- sl@0: sl@0: // the return type of try_catch is the return type of the try lambda_functor sl@0: // (the return types of try and catch parts must match unless try returns void sl@0: // or the catch part throws for sure) sl@0: sl@0: // NOTE, the exception placeholder deduction rule is defined sl@0: // in return_type_traits.hpp sl@0: sl@0: sl@0: sl@0: // defined in control_constructs sl@0: class ifthenelse_action; sl@0: sl@0: namespace detail { sl@0: sl@0: // Templates for deducing, wether a lambda_functor throws inevitably of not - sl@0: // This mechanism is needed to make the compiler happy about sl@0: // return types of try and catch parts. sl@0: sl@0: // a lambda_functor throws for sure if: sl@0: // - it is a throw expression sl@0: // - it is a comma expression, and one of its arguments throws for sure sl@0: // - it is an if_then_else expression and either the if statement or both sl@0: // the then and else throw. sl@0: // (there are other cases as well, but we do not cover them) sl@0: // e.g. _1 + (rethrow(), 3) does throw for sure but this is not checked sl@0: // This implies, that in such a case, the return types of try and catch parts sl@0: // must match if the try part returns other than void. sl@0: // (Such checks could be done though) sl@0: sl@0: template sl@0: struct throws_for_sure_phase2 { sl@0: static const bool value = false; sl@0: }; sl@0: sl@0: template sl@0: struct throws_for_sure_phase2< sl@0: lambda_functor< sl@0: lambda_functor_base >, Args> sl@0: > sl@0: > sl@0: { sl@0: static const bool value = true; sl@0: }; sl@0: sl@0: // Both then and else or the if throw of an if_then_else. sl@0: template sl@0: struct throws_for_sure_phase2< sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: ifthenelse_action, Args sl@0: > sl@0: > sl@0: > sl@0: { sl@0: static const bool value = sl@0: throws_for_sure_phase2< sl@0: typename boost::tuples::element<0, Args>::type>::value sl@0: || sl@0: ( sl@0: throws_for_sure_phase2< sl@0: typename boost::tuples::element<1, Args>::type sl@0: >::value sl@0: && sl@0: throws_for_sure_phase2< sl@0: typename boost::tuples::element<2, Args>::type sl@0: >::value sl@0: ); sl@0: }; sl@0: sl@0: template sl@0: struct throws_for_sure_phase2< sl@0: lambda_functor< sl@0: lambda_functor_base< other_action, Args> sl@0: > sl@0: > sl@0: { sl@0: static const bool value = sl@0: throws_for_sure_phase2< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::value sl@0: || sl@0: throws_for_sure_phase2< sl@0: typename boost::tuples::element<1, Args>::type sl@0: >::value; sl@0: }; sl@0: sl@0: // get rid of any qualifiers and references sl@0: // lambda_functors should be stored like that, so this is to be extra sure sl@0: template sl@0: struct throws_for_sure { sl@0: static const bool value sl@0: = throws_for_sure_phase2< sl@0: typename detail::remove_reference_and_cv::type sl@0: >::value; sl@0: }; sl@0: sl@0: sl@0: // -- return_or_throw templates ----------------------------- sl@0: sl@0: // false case, catch and try return types are incompatible sl@0: // Now the catch part must throw for sure, otherwise a compile time error sl@0: // occurs. sl@0: template sl@0: struct return_or_throw_phase2 { sl@0: template sl@0: static RET call(Arg& arg, CALL_FORMAL_ARGS) { sl@0: BOOST_STATIC_ASSERT(throws_for_sure::value); sl@0: detail::select(arg, CALL_ACTUAL_ARGS); // this line throws sl@0: throw 1; // this line is never performed, hence 1 is just a dummy sl@0: // The line is needed to make compiler happy and not require sl@0: // a matching return type sl@0: } sl@0: }; sl@0: sl@0: // the try and catch return types are compatible sl@0: template<> sl@0: struct return_or_throw_phase2 { sl@0: template sl@0: static RET call(Arg& arg, CALL_FORMAL_ARGS) { sl@0: return detail::select(arg, CALL_ACTUAL_ARGS); sl@0: } sl@0: }; sl@0: sl@0: sl@0: // the non-void case. Try part returns a value, so catch parts must sl@0: // return a value of the same type or throw sl@0: template sl@0: struct return_or_throw { sl@0: // Arg should be equal to ARG except that ARG may be a reference sl@0: // to be sure, that there are no suprises for peculiarly defined return types sl@0: // ARG is passed explicitely sl@0: template sl@0: static RET call(Arg& arg, CALL_FORMAL_ARGS) sl@0: { sl@0: // typedef typename Arg::return_type >::type RT; sl@0: typedef typename as_lambda_functor::type lf_type; sl@0: typedef typename lf_type::inherited::template sl@0: sig >::type RT; sl@0: sl@0: return sl@0: return_or_throw_phase2< sl@0: ::boost::is_convertible::value sl@0: >::template call(arg, CALL_ACTUAL_ARGS); sl@0: } sl@0: }; sl@0: sl@0: // if try part returns void, we do not return the catch parts either sl@0: template sl@0: struct return_or_throw { sl@0: template sl@0: static void call(Arg& arg, CALL_FORMAL_ARGS) { detail::select(arg, CALL_ACTUAL_ARGS); } sl@0: }; sl@0: sl@0: } // end detail sl@0: sl@0: // Throwing exceptions --------------------------------------------- sl@0: sl@0: namespace detail { sl@0: sl@0: template struct catch_block {}; sl@0: struct catch_all_block {}; sl@0: sl@0: template struct exception_catch_tag {}; sl@0: sl@0: // normal catch block is represented as sl@0: // tagged_lambda_functor > >, LambdaFunctor> sl@0: sl@0: // the default catch all block as: sl@0: // tagged_lambda_functor >, LambdaFunctor> sl@0: sl@0: sl@0: } // end detail sl@0: sl@0: // the code is RETHROW, this ensures that a compile time error results, sl@0: // if this lambda_functor is used outside a delayed catch_expression sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action<0, throw_action >, sl@0: null_type sl@0: > sl@0: > sl@0: rethrow() { sl@0: return sl@0: lambda_functor_base< sl@0: action<0, throw_action >, sl@0: null_type sl@0: > sl@0: ( null_type() ); sl@0: } sl@0: sl@0: template sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action<1, throw_action >, sl@0: tuple::type> sl@0: > sl@0: > sl@0: throw_exception(const Arg1& a1) { sl@0: return sl@0: lambda_functor_base< sl@0: action<1, throw_action >, sl@0: tuple::type> sl@0: > sl@0: ( tuple::type>(a1)); sl@0: } sl@0: sl@0: // create catch blocks sl@0: template sl@0: inline const sl@0: tagged_lambda_functor< sl@0: detail::exception_catch_tag >, sl@0: lambda_functor sl@0: > sl@0: catch_exception(const lambda_functor& a) { sl@0: // the third placeholder cannot be used in catch_exception sl@0: // BOOST_STATIC_ASSERT((!has_placeholder::value)); sl@0: return sl@0: tagged_lambda_functor< sl@0: detail::exception_catch_tag >, sl@0: lambda_functor sl@0: > (a); sl@0: } sl@0: sl@0: // catch and do nothing case. sl@0: template sl@0: inline const sl@0: tagged_lambda_functor< sl@0: detail::exception_catch_tag >, sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: do_nothing_action, sl@0: null_type sl@0: > sl@0: > sl@0: > sl@0: catch_exception() { sl@0: return sl@0: tagged_lambda_functor< sl@0: detail::exception_catch_tag >, sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: do_nothing_action, sl@0: null_type sl@0: > sl@0: > sl@0: > (); sl@0: } sl@0: sl@0: // create catch(...) blocks sl@0: template sl@0: inline const sl@0: tagged_lambda_functor< sl@0: detail::exception_catch_tag, sl@0: lambda_functor sl@0: > sl@0: catch_all(const lambda_functor& a) { sl@0: // the third placeholder cannot be used in catch_exception sl@0: BOOST_STATIC_ASSERT((!has_placeholder::value)); sl@0: return sl@0: tagged_lambda_functor< sl@0: detail::exception_catch_tag, sl@0: lambda_functor sl@0: > (a); sl@0: } sl@0: sl@0: // catch(...) and do nothing case. sl@0: inline const sl@0: tagged_lambda_functor< sl@0: detail::exception_catch_tag, sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: do_nothing_action, sl@0: null_type sl@0: > sl@0: > sl@0: > sl@0: catch_all() { sl@0: return sl@0: tagged_lambda_functor< sl@0: detail::exception_catch_tag, sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: do_nothing_action, sl@0: null_type sl@0: > sl@0: > sl@0: > (); sl@0: } sl@0: sl@0: // try_catch functions -------------------------------- sl@0: // The second -> N argument(s) are must be catch lambda_functors sl@0: template sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action<2, try_catch_action > >, sl@0: tuple, LF1> sl@0: > sl@0: > sl@0: try_catch( sl@0: const lambda_functor& a1, sl@0: const tagged_lambda_functor, LF1>& a2) sl@0: { sl@0: return sl@0: lambda_functor_base< sl@0: action<2, try_catch_action > >, sl@0: tuple, LF1> sl@0: > sl@0: ( tuple< lambda_functor, LF1>(a1, a2)); sl@0: } sl@0: sl@0: template sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action<3, try_catch_action, Catch2> > >, sl@0: tuple, LF1, LF2> sl@0: > sl@0: > sl@0: try_catch( sl@0: const lambda_functor& a1, sl@0: const tagged_lambda_functor >, LF1>& a2, sl@0: const tagged_lambda_functor, LF2>& a3) sl@0: { sl@0: return sl@0: lambda_functor_base< sl@0: action<3, try_catch_action, Catch2> > >, sl@0: tuple, LF1, LF2> sl@0: > sl@0: ( tuple, LF1, LF2>(a1, a2, a3)); sl@0: } sl@0: sl@0: template sl@0: inline const lambda_functor< sl@0: lambda_functor_base< sl@0: action<4, try_catch_action, detail::catch_block, Catch3> > >, sl@0: tuple, LF1, LF2, LF3> sl@0: > sl@0: > sl@0: try_catch( sl@0: const lambda_functor& a1, sl@0: const tagged_lambda_functor >, LF1>& a2, sl@0: const tagged_lambda_functor >, LF2>& a3, sl@0: const tagged_lambda_functor, LF3>& a4) sl@0: { sl@0: return sl@0: lambda_functor_base< sl@0: action<4, try_catch_action, detail::catch_block, Catch3> > >, sl@0: tuple, LF1, LF2, LF3> sl@0: > sl@0: ( tuple, LF1, LF2, LF3>(a1, a2, a3, a4)); sl@0: } sl@0: sl@0: template sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action< sl@0: 5, sl@0: try_catch_action< sl@0: catch_action, detail::catch_block, detail::catch_block, Catch4> sl@0: > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4> sl@0: > sl@0: > sl@0: try_catch( sl@0: const lambda_functor& a1, sl@0: const tagged_lambda_functor >, LF1>& a2, sl@0: const tagged_lambda_functor >, LF2>& a3, sl@0: const tagged_lambda_functor >, LF3>& a4, sl@0: const tagged_lambda_functor, LF4>& a5) sl@0: { sl@0: return sl@0: lambda_functor_base< sl@0: action< sl@0: 5, sl@0: try_catch_action, detail::catch_block, detail::catch_block, Catch4> > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4> sl@0: > sl@0: ( tuple, LF1, LF2, LF3, LF4>(a1, a2, a3, a4, a5)); sl@0: } sl@0: sl@0: template sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action< sl@0: 6, sl@0: try_catch_action, detail::catch_block, detail::catch_block, detail::catch_block, Catch5> > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4, LF5> sl@0: > sl@0: > sl@0: try_catch( sl@0: const lambda_functor& a1, sl@0: const tagged_lambda_functor >, LF1>& a2, sl@0: const tagged_lambda_functor >, LF2>& a3, sl@0: const tagged_lambda_functor >, LF3>& a4, sl@0: const tagged_lambda_functor >, LF4>& a5, sl@0: const tagged_lambda_functor, LF5>& a6) sl@0: { sl@0: return sl@0: lambda_functor_base< sl@0: action< sl@0: 6, sl@0: try_catch_action< sl@0: catch_action, detail::catch_block, detail::catch_block, detail::catch_block, Catch5> sl@0: > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4, LF5> sl@0: > sl@0: ( tuple, LF1, LF2, LF3, LF4, LF5> sl@0: (a1, a2, a3, a4, a5, a6) sl@0: ); sl@0: } sl@0: sl@0: template sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action< sl@0: 7, sl@0: try_catch_action< sl@0: catch_action, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, Catch6> sl@0: > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4, LF5, LF6> sl@0: > sl@0: > sl@0: try_catch( sl@0: const lambda_functor& a1, sl@0: const tagged_lambda_functor >, LF1>& a2, sl@0: const tagged_lambda_functor >, LF2>& a3, sl@0: const tagged_lambda_functor >, LF3>& a4, sl@0: const tagged_lambda_functor >, LF4>& a5, sl@0: const tagged_lambda_functor >, LF5>& a6, sl@0: const tagged_lambda_functor, LF6>& a7) sl@0: { sl@0: return sl@0: lambda_functor_base< sl@0: action< sl@0: 7, sl@0: try_catch_action< sl@0: catch_action, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block,Catch6> sl@0: > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4, LF5, LF6> sl@0: > sl@0: ( tuple, LF1, LF2, LF3, LF4, LF5, LF6> sl@0: (a1, a2, a3, a4, a5, a6, a7)); sl@0: } sl@0: sl@0: template sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action< sl@0: 8, sl@0: try_catch_action< sl@0: catch_action, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, Catch7> sl@0: > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4, LF5, LF6, LF7> sl@0: > sl@0: > sl@0: try_catch( sl@0: const lambda_functor& a1, sl@0: const tagged_lambda_functor >, LF1>& a2, sl@0: const tagged_lambda_functor >, LF2>& a3, sl@0: const tagged_lambda_functor >, LF3>& a4, sl@0: const tagged_lambda_functor >, LF4>& a5, sl@0: const tagged_lambda_functor >, LF5>& a6, sl@0: const tagged_lambda_functor >, LF6>& a7, sl@0: const tagged_lambda_functor, LF7>& a8) sl@0: { sl@0: return sl@0: lambda_functor_base< sl@0: action< sl@0: 8, sl@0: try_catch_action< sl@0: catch_action< sl@0: detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, Catch7 sl@0: > sl@0: > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4, LF5, LF6, LF7> sl@0: > sl@0: ( tuple, LF1, LF2, LF3, LF4, LF5, LF6, LF7> sl@0: (a1, a2, a3, a4, a5, a6, a7, a8)); sl@0: } sl@0: sl@0: template sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action< sl@0: 9, sl@0: try_catch_action< sl@0: catch_action< sl@0: detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, Catch8 sl@0: > sl@0: > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8> sl@0: > sl@0: > sl@0: try_catch( sl@0: const lambda_functor& a1, sl@0: const tagged_lambda_functor >, LF1>& a2, sl@0: const tagged_lambda_functor >, LF2>& a3, sl@0: const tagged_lambda_functor >, LF3>& a4, sl@0: const tagged_lambda_functor >, LF4>& a5, sl@0: const tagged_lambda_functor >, LF5>& a6, sl@0: const tagged_lambda_functor >, LF6>& a7, sl@0: const tagged_lambda_functor >, LF7>& a8, sl@0: const tagged_lambda_functor, LF8>& a9) sl@0: { sl@0: return sl@0: lambda_functor_base< sl@0: action< sl@0: 9, sl@0: try_catch_action< sl@0: catch_action< sl@0: detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, Catch8 sl@0: > sl@0: > sl@0: >, sl@0: tuple, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8> sl@0: > sl@0: ( tuple, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8> sl@0: (a1, a2, a3, a4, a5, a6, a7, a8, a9)); sl@0: } sl@0: sl@0: template sl@0: inline const sl@0: lambda_functor< sl@0: lambda_functor_base< sl@0: action< sl@0: 10, sl@0: try_catch_action< sl@0: catch_action< sl@0: detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, sl@0: Catch9 sl@0: > sl@0: > sl@0: >, sl@0: tuple< sl@0: lambda_functor, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9 sl@0: > sl@0: > sl@0: > sl@0: try_catch( sl@0: const lambda_functor& a1, sl@0: const tagged_lambda_functor >, LF1>& a2, sl@0: const tagged_lambda_functor >, LF2>& a3, sl@0: const tagged_lambda_functor >, LF3>& a4, sl@0: const tagged_lambda_functor >, LF4>& a5, sl@0: const tagged_lambda_functor >, LF5>& a6, sl@0: const tagged_lambda_functor >, LF6>& a7, sl@0: const tagged_lambda_functor >, LF7>& a8, sl@0: const tagged_lambda_functor >, LF8>& a9, sl@0: const tagged_lambda_functor, LF9>& a10) sl@0: { sl@0: return sl@0: lambda_functor_base< sl@0: action< sl@0: 10, sl@0: try_catch_action< sl@0: catch_action< sl@0: detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, sl@0: Catch9 sl@0: > sl@0: > sl@0: >, sl@0: tuple< sl@0: lambda_functor, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9 sl@0: > sl@0: > sl@0: ( tuple< sl@0: lambda_functor, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9 sl@0: >(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)); sl@0: } sl@0: sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // Specializations for lambda_functor_base of try_catch ---------------------- sl@0: sl@0: // 1 catch type case sl@0: sl@0: template sl@0: class lambda_functor_base< sl@0: action<2, try_catch_action > > >, sl@0: Args sl@0: > sl@0: { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: // the return type of try_catch is the return type of the try lambda_functor sl@0: // (the return types of try and catch parts must match unless try returns void sl@0: // or the catch part throws for sure) sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: sl@0: sl@0: template sl@0: class lambda_functor_base > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (...) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: sl@0: // 2 catch types case sl@0: template sl@0: class lambda_functor_base, detail::catch_block > > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: template sl@0: class lambda_functor_base,detail::catch_all_block> > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (...) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: // 3 catch types case sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block > > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: template sl@0: class lambda_functor_base, detail::catch_block,detail::catch_all_block> > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (...) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: // 4 catch types case sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block > > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block,detail::catch_all_block> > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (...) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: // 5 catch types case sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block > > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch5& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block,detail::catch_all_block> > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (...) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: // 6 catch types case sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block > > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch5& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch6& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block,detail::catch_all_block> > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch5& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (...) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: // 7 catch types case sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block > > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch5& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch6& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch7& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, sl@0: detail::catch_all_block> > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch5& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch6& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (...) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: // 8 catch types case sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, sl@0: detail::catch_block, detail::catch_block > > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch5& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch6& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch7& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch8& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, sl@0: detail::catch_block,detail::catch_all_block> > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch5& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch6& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch7& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (...) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: // 9 catch types case sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, sl@0: detail::catch_block, detail::catch_block, detail::catch_block > > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch5& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch6& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch7& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch8& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch9& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<9>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: template sl@0: class lambda_functor_base, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, detail::catch_block, sl@0: detail::catch_block, detail::catch_block,detail::catch_all_block> > >, Args> { sl@0: public: sl@0: Args args; sl@0: public: sl@0: explicit lambda_functor_base(const Args& a) : args(a) {} sl@0: sl@0: template struct sig { sl@0: typedef typename sl@0: as_lambda_functor< sl@0: typename boost::tuples::element<0, Args>::type sl@0: >::type lf_type; sl@0: sl@0: typedef typename lf_type::inherited::template sig::type type; sl@0: }; sl@0: sl@0: template sl@0: RET call(CALL_FORMAL_ARGS) const { sl@0: try sl@0: { sl@0: return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: catch (Catch1& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch2& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch3& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch4& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch5& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch6& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch7& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (Catch8& e) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e); sl@0: } sl@0: catch (...) sl@0: { sl@0: return sl@0: detail::return_or_throw::type> sl@0: ::call(::boost::tuples::get<9>(args), CALL_ACTUAL_ARGS); sl@0: } sl@0: } sl@0: }; sl@0: sl@0: sl@0: } // namespace lambda sl@0: } // namespace boost sl@0: sl@0: sl@0: #endif sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: