1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/lambda/exceptions.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,1740 @@
1.4 +// -- Boost Lambda Library -- exceptions.hpp ----------------
1.5 +//
1.6 +// Copyright (C) 2000 Gary Powell (gwpowell@hotmail.com)
1.7 +// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
1.8 +//
1.9 +// Distributed under the Boost Software License, Version 1.0. (See
1.10 +// accompanying file LICENSE_1_0.txt or copy at
1.11 +// http://www.boost.org/LICENSE_1_0.txt)
1.12 +//
1.13 +// For more information, see http://www.boost.org
1.14 +
1.15 +// -----------------------------------------------------
1.16 +
1.17 +#if !defined(BOOST_LAMBDA_EXCEPTIONS_HPP)
1.18 +#define BOOST_LAMBDA_EXCEPTIONS_HPP
1.19 +
1.20 +#include "boost/lambda/detail/control_constructs_common.hpp"
1.21 +
1.22 +namespace boost {
1.23 +namespace lambda {
1.24 +
1.25 +typedef lambda_functor<placeholder<EXCEPTION> > placeholderE_type;
1.26 +
1.27 +namespace {
1.28 + boost::lambda::placeholderE_type freeE;
1.29 + boost::lambda::placeholderE_type& _e = freeE;
1.30 +}
1.31 +
1.32 +// -- exception related actions -------------------
1.33 +
1.34 +// catch actions.
1.35 +template <class Catch1, class Catch2 = null_type, class Catch3 = null_type,
1.36 + class Catch4 = null_type, class Catch5 = null_type,
1.37 + class Catch6 = null_type, class Catch7 = null_type,
1.38 + class Catch8 = null_type, class Catch9 = null_type,
1.39 + class Catch10 = null_type>
1.40 +struct catch_action {};
1.41 +
1.42 +struct catch_all_action {};
1.43 +
1.44 +template<class CatchActions>
1.45 +struct return_try_catch_action {};
1.46 +
1.47 +template<class CatchActions>
1.48 +struct try_catch_action {};
1.49 +
1.50 +// rethrow actions
1.51 +struct throw_new_action {};
1.52 +struct rethrow_action {};
1.53 +
1.54 +template<class ThrowType> struct throw_action;
1.55 +
1.56 +template<>
1.57 +struct throw_action<rethrow_action> {
1.58 + template<class RET>
1.59 + static RET apply() {
1.60 + throw;
1.61 + }
1.62 +};
1.63 +
1.64 +template<> struct throw_action<throw_new_action> {
1.65 + template<class RET, class T>
1.66 + static RET apply(T& t) {
1.67 + throw t;
1.68 + }
1.69 +};
1.70 +
1.71 +// return types for throw_actions --------------------------------------------
1.72 +
1.73 +template<class T, class Any>
1.74 +struct
1.75 +return_type_N<throw_action<T>, Any> {
1.76 + typedef void type;
1.77 +};
1.78 +
1.79 +
1.80 +// return types deductions -------------------------------------------------
1.81 +
1.82 +// the return type of try_catch is the return type of the try lambda_functor
1.83 +// (the return types of try and catch parts must match unless try returns void
1.84 +// or the catch part throws for sure)
1.85 +
1.86 +// NOTE, the exception placeholder deduction rule is defined
1.87 +// in return_type_traits.hpp
1.88 +
1.89 +
1.90 +
1.91 +// defined in control_constructs
1.92 +class ifthenelse_action;
1.93 +
1.94 +namespace detail {
1.95 +
1.96 +// Templates for deducing, wether a lambda_functor throws inevitably of not -
1.97 +// This mechanism is needed to make the compiler happy about
1.98 +// return types of try and catch parts.
1.99 +
1.100 +// a lambda_functor throws for sure if:
1.101 +// - it is a throw expression
1.102 +// - it is a comma expression, and one of its arguments throws for sure
1.103 +// - it is an if_then_else expression and either the if statement or both
1.104 +// the then and else throw.
1.105 +// (there are other cases as well, but we do not cover them)
1.106 +// e.g. _1 + (rethrow(), 3) does throw for sure but this is not checked
1.107 +// This implies, that in such a case, the return types of try and catch parts
1.108 +// must match if the try part returns other than void.
1.109 +// (Such checks could be done though)
1.110 +
1.111 +template <class Arg>
1.112 +struct throws_for_sure_phase2 {
1.113 + static const bool value = false;
1.114 +};
1.115 +
1.116 +template <int N, class ThrowType, class Args>
1.117 +struct throws_for_sure_phase2<
1.118 + lambda_functor<
1.119 + lambda_functor_base<action<N, throw_action<ThrowType> >, Args>
1.120 + >
1.121 +>
1.122 +{
1.123 + static const bool value = true;
1.124 +};
1.125 +
1.126 +// Both then and else or the if throw of an if_then_else.
1.127 +template <class Args>
1.128 +struct throws_for_sure_phase2<
1.129 + lambda_functor<
1.130 + lambda_functor_base<
1.131 + ifthenelse_action, Args
1.132 + >
1.133 + >
1.134 +>
1.135 +{
1.136 + static const bool value =
1.137 + throws_for_sure_phase2<
1.138 + typename boost::tuples::element<0, Args>::type>::value
1.139 + ||
1.140 + (
1.141 + throws_for_sure_phase2<
1.142 + typename boost::tuples::element<1, Args>::type
1.143 + >::value
1.144 + &&
1.145 + throws_for_sure_phase2<
1.146 + typename boost::tuples::element<2, Args>::type
1.147 + >::value
1.148 + );
1.149 +};
1.150 +
1.151 +template <class Args>
1.152 +struct throws_for_sure_phase2<
1.153 + lambda_functor<
1.154 + lambda_functor_base< other_action<comma_action>, Args>
1.155 + >
1.156 +>
1.157 +{
1.158 + static const bool value =
1.159 + throws_for_sure_phase2<
1.160 + typename boost::tuples::element<0, Args>::type
1.161 + >::value
1.162 + ||
1.163 + throws_for_sure_phase2<
1.164 + typename boost::tuples::element<1, Args>::type
1.165 + >::value;
1.166 +};
1.167 +
1.168 + // get rid of any qualifiers and references
1.169 + // lambda_functors should be stored like that, so this is to be extra sure
1.170 +template <class Arg>
1.171 +struct throws_for_sure {
1.172 + static const bool value
1.173 + = throws_for_sure_phase2<
1.174 + typename detail::remove_reference_and_cv<Arg>::type
1.175 + >::value;
1.176 +};
1.177 +
1.178 +
1.179 +// -- return_or_throw templates -----------------------------
1.180 +
1.181 +// false case, catch and try return types are incompatible
1.182 +// Now the catch part must throw for sure, otherwise a compile time error
1.183 +// occurs.
1.184 +template<bool is_conversion>
1.185 +struct return_or_throw_phase2 {
1.186 + template<class RET, class Arg, CALL_TEMPLATE_ARGS>
1.187 + static RET call(Arg& arg, CALL_FORMAL_ARGS) {
1.188 + BOOST_STATIC_ASSERT(throws_for_sure<Arg>::value);
1.189 + detail::select(arg, CALL_ACTUAL_ARGS); // this line throws
1.190 + throw 1; // this line is never performed, hence 1 is just a dummy
1.191 + // The line is needed to make compiler happy and not require
1.192 + // a matching return type
1.193 + }
1.194 +};
1.195 +
1.196 +// the try and catch return types are compatible
1.197 +template<>
1.198 +struct return_or_throw_phase2<true> {
1.199 + template<class RET, class Arg, CALL_TEMPLATE_ARGS>
1.200 + static RET call(Arg& arg, CALL_FORMAL_ARGS) {
1.201 + return detail::select(arg, CALL_ACTUAL_ARGS);
1.202 + }
1.203 +};
1.204 +
1.205 +
1.206 +// the non-void case. Try part returns a value, so catch parts must
1.207 +// return a value of the same type or throw
1.208 +template<class RET, class ARG>
1.209 +struct return_or_throw {
1.210 + // Arg should be equal to ARG except that ARG may be a reference
1.211 + // to be sure, that there are no suprises for peculiarly defined return types
1.212 + // ARG is passed explicitely
1.213 + template<class Arg, CALL_TEMPLATE_ARGS>
1.214 + static RET call(Arg& arg, CALL_FORMAL_ARGS)
1.215 + {
1.216 + // typedef typename Arg::return_type<ARG, open_args<A&, B&, C&> >::type RT;
1.217 + typedef typename as_lambda_functor<ARG>::type lf_type;
1.218 + typedef typename lf_type::inherited::template
1.219 + sig<tuple<CALL_REFERENCE_TYPES> >::type RT;
1.220 +
1.221 + return
1.222 + return_or_throw_phase2<
1.223 + ::boost::is_convertible<RT, RET>::value
1.224 + >::template call<RET>(arg, CALL_ACTUAL_ARGS);
1.225 + }
1.226 +};
1.227 +
1.228 +// if try part returns void, we do not return the catch parts either
1.229 +template<class ARG>
1.230 +struct return_or_throw<void, ARG> {
1.231 + template<class Arg, CALL_TEMPLATE_ARGS>
1.232 + static void call(Arg& arg, CALL_FORMAL_ARGS) { detail::select(arg, CALL_ACTUAL_ARGS); }
1.233 +};
1.234 +
1.235 +} // end detail
1.236 +
1.237 +// Throwing exceptions ---------------------------------------------
1.238 +
1.239 +namespace detail {
1.240 +
1.241 +template <class T> struct catch_block {};
1.242 +struct catch_all_block {};
1.243 +
1.244 +template <class T> struct exception_catch_tag {};
1.245 +
1.246 +// normal catch block is represented as
1.247 +// tagged_lambda_functor<exception_catch_tag<catch_type<T> > >, LambdaFunctor>
1.248 +
1.249 +// the default catch all block as:
1.250 +// tagged_lambda_functor<exception_catch_tag<catch_all_block> >, LambdaFunctor>
1.251 +
1.252 +
1.253 +} // end detail
1.254 +
1.255 +// the code is RETHROW, this ensures that a compile time error results,
1.256 +// if this lambda_functor is used outside a delayed catch_expression
1.257 +inline const
1.258 +lambda_functor<
1.259 + lambda_functor_base<
1.260 + action<0, throw_action<rethrow_action> >,
1.261 + null_type
1.262 + >
1.263 +>
1.264 +rethrow() {
1.265 + return
1.266 + lambda_functor_base<
1.267 + action<0, throw_action<rethrow_action> >,
1.268 + null_type
1.269 + >
1.270 + ( null_type() );
1.271 +}
1.272 +
1.273 +template <class Arg1>
1.274 +inline const
1.275 +lambda_functor<
1.276 + lambda_functor_base<
1.277 + action<1, throw_action<throw_new_action> >,
1.278 + tuple<typename const_copy_argument<const Arg1>::type>
1.279 + >
1.280 +>
1.281 +throw_exception(const Arg1& a1) {
1.282 + return
1.283 + lambda_functor_base<
1.284 + action<1, throw_action<throw_new_action> >,
1.285 + tuple<typename const_copy_argument<const Arg1>::type>
1.286 + >
1.287 + ( tuple<typename const_copy_argument<const Arg1>::type>(a1));
1.288 +}
1.289 +
1.290 +// create catch blocks
1.291 +template <class CatchType, class Arg>
1.292 +inline const
1.293 +tagged_lambda_functor<
1.294 + detail::exception_catch_tag<detail::catch_block<CatchType> >,
1.295 + lambda_functor<Arg>
1.296 +>
1.297 +catch_exception(const lambda_functor<Arg>& a) {
1.298 + // the third placeholder cannot be used in catch_exception
1.299 + // BOOST_STATIC_ASSERT((!has_placeholder<Arg, THIRD>::value));
1.300 + return
1.301 + tagged_lambda_functor<
1.302 + detail::exception_catch_tag<detail::catch_block<CatchType> >,
1.303 + lambda_functor<Arg>
1.304 + > (a);
1.305 +}
1.306 +
1.307 +// catch and do nothing case.
1.308 +template <class CatchType>
1.309 +inline const
1.310 +tagged_lambda_functor<
1.311 + detail::exception_catch_tag<detail::catch_block<CatchType> >,
1.312 + lambda_functor<
1.313 + lambda_functor_base<
1.314 + do_nothing_action,
1.315 + null_type
1.316 + >
1.317 + >
1.318 +>
1.319 +catch_exception() {
1.320 + return
1.321 + tagged_lambda_functor<
1.322 + detail::exception_catch_tag<detail::catch_block<CatchType> >,
1.323 + lambda_functor<
1.324 + lambda_functor_base<
1.325 + do_nothing_action,
1.326 + null_type
1.327 + >
1.328 + >
1.329 + > ();
1.330 +}
1.331 +
1.332 +// create catch(...) blocks
1.333 +template <class Arg>
1.334 +inline const
1.335 +tagged_lambda_functor<
1.336 + detail::exception_catch_tag<detail::catch_all_block>,
1.337 + lambda_functor<Arg>
1.338 +>
1.339 +catch_all(const lambda_functor<Arg>& a) {
1.340 + // the third placeholder cannot be used in catch_exception
1.341 + BOOST_STATIC_ASSERT((!has_placeholder<Arg, THIRD>::value));
1.342 + return
1.343 + tagged_lambda_functor<
1.344 + detail::exception_catch_tag<detail::catch_all_block>,
1.345 + lambda_functor<Arg>
1.346 + > (a);
1.347 +}
1.348 +
1.349 +// catch(...) and do nothing case.
1.350 +inline const
1.351 +tagged_lambda_functor<
1.352 + detail::exception_catch_tag<detail::catch_all_block>,
1.353 + lambda_functor<
1.354 + lambda_functor_base<
1.355 + do_nothing_action,
1.356 + null_type
1.357 + >
1.358 + >
1.359 +>
1.360 +catch_all() {
1.361 + return
1.362 + tagged_lambda_functor<
1.363 + detail::exception_catch_tag<detail::catch_all_block>,
1.364 + lambda_functor<
1.365 + lambda_functor_base<
1.366 + do_nothing_action,
1.367 + null_type
1.368 + >
1.369 + >
1.370 + > ();
1.371 +}
1.372 +
1.373 +// try_catch functions --------------------------------
1.374 +// The second -> N argument(s) are must be catch lambda_functors
1.375 +template <class TryArg, class Catch1, class LF1>
1.376 +inline const
1.377 +lambda_functor<
1.378 + lambda_functor_base<
1.379 + action<2, try_catch_action<catch_action<Catch1> > >,
1.380 + tuple<lambda_functor<TryArg>, LF1>
1.381 + >
1.382 +>
1.383 +try_catch(
1.384 + const lambda_functor<TryArg>& a1,
1.385 + const tagged_lambda_functor<detail::exception_catch_tag<Catch1>, LF1>& a2)
1.386 +{
1.387 + return
1.388 + lambda_functor_base<
1.389 + action<2, try_catch_action<catch_action<Catch1> > >,
1.390 + tuple<lambda_functor<TryArg>, LF1>
1.391 + >
1.392 + ( tuple< lambda_functor<TryArg>, LF1>(a1, a2));
1.393 +}
1.394 +
1.395 +template <class TryArg, class Catch1, class LF1,
1.396 + class Catch2, class LF2>
1.397 +inline const
1.398 + lambda_functor<
1.399 + lambda_functor_base<
1.400 + action<3, try_catch_action<catch_action<detail::catch_block<Catch1>, Catch2> > >,
1.401 + tuple<lambda_functor<TryArg>, LF1, LF2>
1.402 + >
1.403 +>
1.404 +try_catch(
1.405 + const lambda_functor<TryArg>& a1,
1.406 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
1.407 + const tagged_lambda_functor<detail::exception_catch_tag<Catch2>, LF2>& a3)
1.408 +{
1.409 + return
1.410 + lambda_functor_base<
1.411 + action<3, try_catch_action<catch_action<detail::catch_block<Catch1>, Catch2> > >,
1.412 + tuple<lambda_functor<TryArg>, LF1, LF2>
1.413 + >
1.414 + ( tuple<lambda_functor<TryArg>, LF1, LF2>(a1, a2, a3));
1.415 +}
1.416 +
1.417 +template <class TryArg, class Catch1, class LF1,
1.418 + class Catch2, class LF2,
1.419 + class Catch3, class LF3>
1.420 +inline const lambda_functor<
1.421 + lambda_functor_base<
1.422 + action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, Catch3> > >,
1.423 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3>
1.424 + >
1.425 +>
1.426 +try_catch(
1.427 + const lambda_functor<TryArg>& a1,
1.428 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
1.429 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
1.430 + const tagged_lambda_functor<detail::exception_catch_tag<Catch3>, LF3>& a4)
1.431 +{
1.432 + return
1.433 + lambda_functor_base<
1.434 + action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, Catch3> > >,
1.435 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3>
1.436 + >
1.437 + ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3>(a1, a2, a3, a4));
1.438 +}
1.439 +
1.440 +template <class TryArg, class Catch1, class LF1,
1.441 + class Catch2, class LF2,
1.442 + class Catch3, class LF3,
1.443 + class Catch4, class LF4>
1.444 +inline const
1.445 +lambda_functor<
1.446 + lambda_functor_base<
1.447 + action<
1.448 + 5,
1.449 + try_catch_action<
1.450 + catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, Catch4>
1.451 + >
1.452 + >,
1.453 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4>
1.454 + >
1.455 +>
1.456 +try_catch(
1.457 + const lambda_functor<TryArg>& a1,
1.458 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
1.459 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
1.460 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
1.461 + const tagged_lambda_functor<detail::exception_catch_tag<Catch4>, LF4>& a5)
1.462 +{
1.463 + return
1.464 + lambda_functor_base<
1.465 + action<
1.466 + 5,
1.467 + try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, Catch4> >
1.468 + >,
1.469 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4>
1.470 + >
1.471 + ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4>(a1, a2, a3, a4, a5));
1.472 +}
1.473 +
1.474 +template <class TryArg, class Catch1, class LF1,
1.475 + class Catch2, class LF2,
1.476 + class Catch3, class LF3,
1.477 + class Catch4, class LF4,
1.478 + class Catch5, class LF5>
1.479 +inline const
1.480 +lambda_functor<
1.481 + lambda_functor_base<
1.482 + action<
1.483 + 6,
1.484 + try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, Catch5> >
1.485 + >,
1.486 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5>
1.487 + >
1.488 +>
1.489 +try_catch(
1.490 + const lambda_functor<TryArg>& a1,
1.491 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
1.492 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
1.493 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
1.494 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
1.495 + const tagged_lambda_functor<detail::exception_catch_tag<Catch5>, LF5>& a6)
1.496 +{
1.497 + return
1.498 + lambda_functor_base<
1.499 + action<
1.500 + 6,
1.501 + try_catch_action<
1.502 + catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, Catch5>
1.503 + >
1.504 + >,
1.505 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5>
1.506 + >
1.507 + ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5>
1.508 + (a1, a2, a3, a4, a5, a6)
1.509 + );
1.510 +}
1.511 +
1.512 +template <class TryArg, class Catch1, class LF1,
1.513 + class Catch2, class LF2,
1.514 + class Catch3, class LF3,
1.515 + class Catch4, class LF4,
1.516 + class Catch5, class LF5,
1.517 + class Catch6, class LF6>
1.518 +inline const
1.519 +lambda_functor<
1.520 + lambda_functor_base<
1.521 + action<
1.522 + 7,
1.523 + try_catch_action<
1.524 + catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, Catch6>
1.525 + >
1.526 + >,
1.527 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6>
1.528 + >
1.529 +>
1.530 +try_catch(
1.531 + const lambda_functor<TryArg>& a1,
1.532 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
1.533 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
1.534 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
1.535 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
1.536 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
1.537 + const tagged_lambda_functor<detail::exception_catch_tag<Catch6>, LF6>& a7)
1.538 +{
1.539 + return
1.540 + lambda_functor_base<
1.541 + action<
1.542 + 7,
1.543 + try_catch_action<
1.544 + catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>,Catch6>
1.545 + >
1.546 + >,
1.547 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6>
1.548 + >
1.549 + ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6>
1.550 + (a1, a2, a3, a4, a5, a6, a7));
1.551 +}
1.552 +
1.553 +template <class TryArg, class Catch1, class LF1,
1.554 + class Catch2, class LF2,
1.555 + class Catch3, class LF3,
1.556 + class Catch4, class LF4,
1.557 + class Catch5, class LF5,
1.558 + class Catch6, class LF6,
1.559 + class Catch7, class LF7>
1.560 +inline const
1.561 +lambda_functor<
1.562 + lambda_functor_base<
1.563 + action<
1.564 + 8,
1.565 + try_catch_action<
1.566 + 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>
1.567 + >
1.568 + >,
1.569 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7>
1.570 + >
1.571 +>
1.572 +try_catch(
1.573 + const lambda_functor<TryArg>& a1,
1.574 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
1.575 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
1.576 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
1.577 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
1.578 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
1.579 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch6> >, LF6>& a7,
1.580 + const tagged_lambda_functor<detail::exception_catch_tag<Catch7>, LF7>& a8)
1.581 +{
1.582 + return
1.583 + lambda_functor_base<
1.584 + action<
1.585 + 8,
1.586 + try_catch_action<
1.587 + catch_action<
1.588 + 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
1.589 + >
1.590 + >
1.591 + >,
1.592 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7>
1.593 + >
1.594 + ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7>
1.595 + (a1, a2, a3, a4, a5, a6, a7, a8));
1.596 +}
1.597 +
1.598 +template <class TryArg, class Catch1, class LF1,
1.599 + class Catch2, class LF2,
1.600 + class Catch3, class LF3,
1.601 + class Catch4, class LF4,
1.602 + class Catch5, class LF5,
1.603 + class Catch6, class LF6,
1.604 + class Catch7, class LF7,
1.605 + class Catch8, class LF8>
1.606 +inline const
1.607 +lambda_functor<
1.608 + lambda_functor_base<
1.609 + action<
1.610 + 9,
1.611 + try_catch_action<
1.612 + catch_action<
1.613 + 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
1.614 + >
1.615 + >
1.616 + >,
1.617 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8>
1.618 + >
1.619 +>
1.620 +try_catch(
1.621 + const lambda_functor<TryArg>& a1,
1.622 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
1.623 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
1.624 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
1.625 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
1.626 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
1.627 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch6> >, LF6>& a7,
1.628 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch7> >, LF7>& a8,
1.629 + const tagged_lambda_functor<detail::exception_catch_tag<Catch8>, LF8>& a9)
1.630 +{
1.631 + return
1.632 + lambda_functor_base<
1.633 + action<
1.634 + 9,
1.635 + try_catch_action<
1.636 + catch_action<
1.637 + 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
1.638 + >
1.639 + >
1.640 + >,
1.641 + tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8>
1.642 + >
1.643 + ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8>
1.644 + (a1, a2, a3, a4, a5, a6, a7, a8, a9));
1.645 +}
1.646 +
1.647 +template <class TryArg, class Catch1, class LF1,
1.648 + class Catch2, class LF2,
1.649 + class Catch3, class LF3,
1.650 + class Catch4, class LF4,
1.651 + class Catch5, class LF5,
1.652 + class Catch6, class LF6,
1.653 + class Catch7, class LF7,
1.654 + class Catch8, class LF8,
1.655 + class Catch9, class LF9>
1.656 +inline const
1.657 + lambda_functor<
1.658 + lambda_functor_base<
1.659 + action<
1.660 + 10,
1.661 + try_catch_action<
1.662 + catch_action<
1.663 + 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>,
1.664 + Catch9
1.665 + >
1.666 + >
1.667 + >,
1.668 + tuple<
1.669 + lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9
1.670 + >
1.671 + >
1.672 + >
1.673 +try_catch(
1.674 + const lambda_functor<TryArg>& a1,
1.675 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
1.676 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
1.677 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
1.678 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
1.679 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
1.680 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch6> >, LF6>& a7,
1.681 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch7> >, LF7>& a8,
1.682 + const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch8> >, LF8>& a9,
1.683 + const tagged_lambda_functor<detail::exception_catch_tag<Catch9>, LF9>& a10)
1.684 +{
1.685 + return
1.686 + lambda_functor_base<
1.687 + action<
1.688 + 10,
1.689 + try_catch_action<
1.690 + catch_action<
1.691 + 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>,
1.692 + Catch9
1.693 + >
1.694 + >
1.695 + >,
1.696 + tuple<
1.697 + lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9
1.698 + >
1.699 + >
1.700 + ( tuple<
1.701 + lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9
1.702 + >(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10));
1.703 +}
1.704 +
1.705 +
1.706 +// ---------------------------------------------------------------------------
1.707 +// Specializations for lambda_functor_base of try_catch ----------------------
1.708 +
1.709 +// 1 catch type case
1.710 +
1.711 +template<class Args, class Catch1>
1.712 +class lambda_functor_base<
1.713 + action<2, try_catch_action<catch_action<detail::catch_block<Catch1> > > >,
1.714 + Args
1.715 +>
1.716 +{
1.717 +public:
1.718 + Args args;
1.719 +public:
1.720 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.721 +
1.722 +// the return type of try_catch is the return type of the try lambda_functor
1.723 +// (the return types of try and catch parts must match unless try returns void
1.724 +// or the catch part throws for sure)
1.725 +
1.726 + template <class SigArgs> struct sig {
1.727 + typedef typename
1.728 + as_lambda_functor<
1.729 + typename boost::tuples::element<0, Args>::type
1.730 + >::type lf_type;
1.731 +
1.732 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.733 + };
1.734 +
1.735 + template<class RET, CALL_TEMPLATE_ARGS>
1.736 + RET call(CALL_FORMAL_ARGS) const {
1.737 + try
1.738 + {
1.739 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.740 + }
1.741 + catch (Catch1& e)
1.742 + {
1.743 + return
1.744 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.745 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.746 + }
1.747 + }
1.748 +};
1.749 +
1.750 +
1.751 +
1.752 +template<class Args>
1.753 +class lambda_functor_base<action<2, try_catch_action<catch_action<detail::catch_all_block> > >, Args> {
1.754 +public:
1.755 + Args args;
1.756 +public:
1.757 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.758 +
1.759 + template <class SigArgs> struct sig {
1.760 + typedef typename
1.761 + as_lambda_functor<
1.762 + typename boost::tuples::element<0, Args>::type
1.763 + >::type lf_type;
1.764 +
1.765 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.766 + };
1.767 +
1.768 + template<class RET, CALL_TEMPLATE_ARGS>
1.769 + RET call(CALL_FORMAL_ARGS) const {
1.770 + try
1.771 + {
1.772 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.773 + }
1.774 + catch (...)
1.775 + {
1.776 + return
1.777 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.778 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS);
1.779 + }
1.780 + }
1.781 +};
1.782 +
1.783 +
1.784 +// 2 catch types case
1.785 +template<class Args, class Catch1, class Catch2>
1.786 +class lambda_functor_base<action<3, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2> > > >, Args> {
1.787 +public:
1.788 + Args args;
1.789 +public:
1.790 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.791 +
1.792 + template <class SigArgs> struct sig {
1.793 + typedef typename
1.794 + as_lambda_functor<
1.795 + typename boost::tuples::element<0, Args>::type
1.796 + >::type lf_type;
1.797 +
1.798 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.799 + };
1.800 +
1.801 + template<class RET, CALL_TEMPLATE_ARGS>
1.802 + RET call(CALL_FORMAL_ARGS) const {
1.803 + try
1.804 + {
1.805 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.806 + }
1.807 + catch (Catch1& e)
1.808 + {
1.809 + return
1.810 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.811 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.812 + }
1.813 + catch (Catch2& e)
1.814 + {
1.815 + return
1.816 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.817 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.818 + }
1.819 + }
1.820 +};
1.821 +
1.822 +template<class Args, class Catch1>
1.823 +class lambda_functor_base<action<3, try_catch_action<catch_action<detail::catch_block<Catch1>,detail::catch_all_block> > >, Args> {
1.824 +public:
1.825 + Args args;
1.826 +public:
1.827 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.828 +
1.829 + template <class SigArgs> struct sig {
1.830 + typedef typename
1.831 + as_lambda_functor<
1.832 + typename boost::tuples::element<0, Args>::type
1.833 + >::type lf_type;
1.834 +
1.835 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.836 + };
1.837 +
1.838 + template<class RET, CALL_TEMPLATE_ARGS>
1.839 + RET call(CALL_FORMAL_ARGS) const {
1.840 + try
1.841 + {
1.842 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.843 + }
1.844 + catch (Catch1& e)
1.845 + {
1.846 + return
1.847 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.848 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.849 + }
1.850 + catch (...)
1.851 + {
1.852 + return
1.853 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.854 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS);
1.855 + }
1.856 + }
1.857 +};
1.858 +
1.859 +// 3 catch types case
1.860 +template<class Args, class Catch1, class Catch2, class Catch3>
1.861 +class lambda_functor_base<action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3> > > >, Args> {
1.862 +public:
1.863 + Args args;
1.864 +public:
1.865 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.866 +
1.867 + template <class SigArgs> struct sig {
1.868 + typedef typename
1.869 + as_lambda_functor<
1.870 + typename boost::tuples::element<0, Args>::type
1.871 + >::type lf_type;
1.872 +
1.873 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.874 + };
1.875 +
1.876 + template<class RET, CALL_TEMPLATE_ARGS>
1.877 + RET call(CALL_FORMAL_ARGS) const {
1.878 + try
1.879 + {
1.880 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.881 + }
1.882 + catch (Catch1& e)
1.883 + {
1.884 + return
1.885 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.886 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.887 +
1.888 + }
1.889 + catch (Catch2& e)
1.890 + {
1.891 + return
1.892 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.893 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.894 +
1.895 + }
1.896 + catch (Catch3& e)
1.897 + {
1.898 + return
1.899 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.900 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.901 + }
1.902 + }
1.903 +};
1.904 +
1.905 +template<class Args, class Catch1, class Catch2>
1.906 +class lambda_functor_base<action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>,detail::catch_all_block> > >, Args> {
1.907 +public:
1.908 + Args args;
1.909 +public:
1.910 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.911 +
1.912 + template <class SigArgs> struct sig {
1.913 + typedef typename
1.914 + as_lambda_functor<
1.915 + typename boost::tuples::element<0, Args>::type
1.916 + >::type lf_type;
1.917 +
1.918 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.919 + };
1.920 +
1.921 + template<class RET, CALL_TEMPLATE_ARGS>
1.922 + RET call(CALL_FORMAL_ARGS) const {
1.923 + try
1.924 + {
1.925 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.926 + }
1.927 + catch (Catch1& e)
1.928 + {
1.929 + return
1.930 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.931 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.932 + }
1.933 + catch (Catch2& e)
1.934 + {
1.935 + return
1.936 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.937 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.938 + }
1.939 + catch (...)
1.940 + {
1.941 + return
1.942 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.943 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS);
1.944 + }
1.945 + }
1.946 +};
1.947 +
1.948 +// 4 catch types case
1.949 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4>
1.950 +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> {
1.951 +public:
1.952 + Args args;
1.953 +public:
1.954 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.955 +
1.956 + template <class SigArgs> struct sig {
1.957 + typedef typename
1.958 + as_lambda_functor<
1.959 + typename boost::tuples::element<0, Args>::type
1.960 + >::type lf_type;
1.961 +
1.962 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.963 + };
1.964 +
1.965 + template<class RET, CALL_TEMPLATE_ARGS>
1.966 + RET call(CALL_FORMAL_ARGS) const {
1.967 + try
1.968 + {
1.969 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.970 + }
1.971 + catch (Catch1& e)
1.972 + {
1.973 + return
1.974 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.975 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.976 + }
1.977 + catch (Catch2& e)
1.978 + {
1.979 + return
1.980 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.981 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.982 + }
1.983 + catch (Catch3& e)
1.984 + {
1.985 + return
1.986 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.987 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.988 + }
1.989 + catch (Catch4& e)
1.990 + {
1.991 + return
1.992 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.993 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.994 + }
1.995 + }
1.996 +};
1.997 +
1.998 +template<class Args, class Catch1, class Catch2, class Catch3>
1.999 +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> {
1.1000 +public:
1.1001 + Args args;
1.1002 +public:
1.1003 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1004 +
1.1005 + template <class SigArgs> struct sig {
1.1006 + typedef typename
1.1007 + as_lambda_functor<
1.1008 + typename boost::tuples::element<0, Args>::type
1.1009 + >::type lf_type;
1.1010 +
1.1011 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1012 + };
1.1013 +
1.1014 + template<class RET, CALL_TEMPLATE_ARGS>
1.1015 + RET call(CALL_FORMAL_ARGS) const {
1.1016 + try
1.1017 + {
1.1018 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1019 + }
1.1020 + catch (Catch1& e)
1.1021 + {
1.1022 + return
1.1023 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1024 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1025 + }
1.1026 + catch (Catch2& e)
1.1027 + {
1.1028 + return
1.1029 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1030 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1031 + }
1.1032 + catch (Catch3& e)
1.1033 + {
1.1034 + return
1.1035 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1036 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1037 + }
1.1038 + catch (...)
1.1039 + {
1.1040 + return
1.1041 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1042 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS);
1.1043 + }
1.1044 + }
1.1045 +};
1.1046 +
1.1047 +// 5 catch types case
1.1048 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5>
1.1049 +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> {
1.1050 +public:
1.1051 + Args args;
1.1052 +public:
1.1053 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1054 +
1.1055 + template <class SigArgs> struct sig {
1.1056 + typedef typename
1.1057 + as_lambda_functor<
1.1058 + typename boost::tuples::element<0, Args>::type
1.1059 + >::type lf_type;
1.1060 +
1.1061 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1062 + };
1.1063 +
1.1064 + template<class RET, CALL_TEMPLATE_ARGS>
1.1065 + RET call(CALL_FORMAL_ARGS) const {
1.1066 + try
1.1067 + {
1.1068 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1069 + }
1.1070 + catch (Catch1& e)
1.1071 + {
1.1072 + return
1.1073 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1074 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1075 + }
1.1076 + catch (Catch2& e)
1.1077 + {
1.1078 + return
1.1079 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1080 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1081 + }
1.1082 + catch (Catch3& e)
1.1083 + {
1.1084 + return
1.1085 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1086 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1087 + }
1.1088 + catch (Catch4& e)
1.1089 + {
1.1090 + return
1.1091 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1092 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1093 + }
1.1094 + catch (Catch5& e)
1.1095 + {
1.1096 + return
1.1097 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1098 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1099 + }
1.1100 + }
1.1101 +};
1.1102 +
1.1103 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4>
1.1104 +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> {
1.1105 +public:
1.1106 + Args args;
1.1107 +public:
1.1108 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1109 +
1.1110 + template <class SigArgs> struct sig {
1.1111 + typedef typename
1.1112 + as_lambda_functor<
1.1113 + typename boost::tuples::element<0, Args>::type
1.1114 + >::type lf_type;
1.1115 +
1.1116 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1117 + };
1.1118 +
1.1119 + template<class RET, CALL_TEMPLATE_ARGS>
1.1120 + RET call(CALL_FORMAL_ARGS) const {
1.1121 + try
1.1122 + {
1.1123 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1124 + }
1.1125 + catch (Catch1& e)
1.1126 + {
1.1127 + return
1.1128 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1129 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1130 + }
1.1131 + catch (Catch2& e)
1.1132 + {
1.1133 + return
1.1134 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1135 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1136 + }
1.1137 + catch (Catch3& e)
1.1138 + {
1.1139 + return
1.1140 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1141 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1142 + }
1.1143 + catch (Catch4& e)
1.1144 + {
1.1145 + return
1.1146 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1147 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1148 + }
1.1149 + catch (...)
1.1150 + {
1.1151 + return
1.1152 + detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1.1153 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS);
1.1154 + }
1.1155 + }
1.1156 +};
1.1157 +
1.1158 +// 6 catch types case
1.1159 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6>
1.1160 +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> {
1.1161 +public:
1.1162 + Args args;
1.1163 +public:
1.1164 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1165 +
1.1166 + template <class SigArgs> struct sig {
1.1167 + typedef typename
1.1168 + as_lambda_functor<
1.1169 + typename boost::tuples::element<0, Args>::type
1.1170 + >::type lf_type;
1.1171 +
1.1172 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1173 + };
1.1174 +
1.1175 + template<class RET, CALL_TEMPLATE_ARGS>
1.1176 + RET call(CALL_FORMAL_ARGS) const {
1.1177 + try
1.1178 + {
1.1179 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1180 + }
1.1181 + catch (Catch1& e)
1.1182 + {
1.1183 + return
1.1184 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1185 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1186 + }
1.1187 + catch (Catch2& e)
1.1188 + {
1.1189 + return
1.1190 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1191 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1192 + }
1.1193 + catch (Catch3& e)
1.1194 + {
1.1195 + return
1.1196 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1197 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1198 + }
1.1199 + catch (Catch4& e)
1.1200 + {
1.1201 + return
1.1202 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1203 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1204 + }
1.1205 + catch (Catch5& e)
1.1206 + {
1.1207 + return
1.1208 + detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1.1209 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1210 + }
1.1211 + catch (Catch6& e)
1.1212 + {
1.1213 + return
1.1214 + detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1.1215 + ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1216 + }
1.1217 + }
1.1218 +};
1.1219 +
1.1220 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5>
1.1221 +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> {
1.1222 +public:
1.1223 + Args args;
1.1224 +public:
1.1225 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1226 +
1.1227 + template <class SigArgs> struct sig {
1.1228 + typedef typename
1.1229 + as_lambda_functor<
1.1230 + typename boost::tuples::element<0, Args>::type
1.1231 + >::type lf_type;
1.1232 +
1.1233 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1234 + };
1.1235 +
1.1236 + template<class RET, CALL_TEMPLATE_ARGS>
1.1237 + RET call(CALL_FORMAL_ARGS) const {
1.1238 + try
1.1239 + {
1.1240 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1241 + }
1.1242 + catch (Catch1& e)
1.1243 + {
1.1244 + return
1.1245 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1246 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1247 + }
1.1248 + catch (Catch2& e)
1.1249 + {
1.1250 + return
1.1251 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1252 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1253 + }
1.1254 + catch (Catch3& e)
1.1255 + {
1.1256 + return
1.1257 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1258 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1259 + }
1.1260 + catch (Catch4& e)
1.1261 + {
1.1262 + return
1.1263 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1264 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1265 + }
1.1266 + catch (Catch5& e)
1.1267 + {
1.1268 + return
1.1269 + detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1.1270 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1271 + }
1.1272 + catch (...)
1.1273 + {
1.1274 + return
1.1275 + detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1.1276 + ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS);
1.1277 + }
1.1278 + }
1.1279 +};
1.1280 +
1.1281 +// 7 catch types case
1.1282 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1.1283 + class Catch7>
1.1284 +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> {
1.1285 +public:
1.1286 + Args args;
1.1287 +public:
1.1288 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1289 +
1.1290 + template <class SigArgs> struct sig {
1.1291 + typedef typename
1.1292 + as_lambda_functor<
1.1293 + typename boost::tuples::element<0, Args>::type
1.1294 + >::type lf_type;
1.1295 +
1.1296 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1297 + };
1.1298 +
1.1299 + template<class RET, CALL_TEMPLATE_ARGS>
1.1300 + RET call(CALL_FORMAL_ARGS) const {
1.1301 + try
1.1302 + {
1.1303 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1304 + }
1.1305 + catch (Catch1& e)
1.1306 + {
1.1307 + return
1.1308 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1309 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1310 + }
1.1311 + catch (Catch2& e)
1.1312 + {
1.1313 + return
1.1314 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1315 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1316 + }
1.1317 + catch (Catch3& e)
1.1318 + {
1.1319 + return
1.1320 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1321 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1322 + }
1.1323 + catch (Catch4& e)
1.1324 + {
1.1325 + return
1.1326 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1327 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1328 + }
1.1329 + catch (Catch5& e)
1.1330 + {
1.1331 + return
1.1332 + detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1.1333 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1334 + }
1.1335 + catch (Catch6& e)
1.1336 + {
1.1337 + return
1.1338 + detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1.1339 + ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1340 + }
1.1341 + catch (Catch7& e)
1.1342 + {
1.1343 + return
1.1344 + detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1.1345 + ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1346 + }
1.1347 + }
1.1348 +};
1.1349 +
1.1350 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6>
1.1351 +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>,
1.1352 + detail::catch_all_block> > >, Args> {
1.1353 +public:
1.1354 + Args args;
1.1355 +public:
1.1356 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1357 +
1.1358 + template <class SigArgs> struct sig {
1.1359 + typedef typename
1.1360 + as_lambda_functor<
1.1361 + typename boost::tuples::element<0, Args>::type
1.1362 + >::type lf_type;
1.1363 +
1.1364 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1365 + };
1.1366 +
1.1367 + template<class RET, CALL_TEMPLATE_ARGS>
1.1368 + RET call(CALL_FORMAL_ARGS) const {
1.1369 + try
1.1370 + {
1.1371 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1372 + }
1.1373 + catch (Catch1& e)
1.1374 + {
1.1375 + return
1.1376 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1377 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1378 + }
1.1379 + catch (Catch2& e)
1.1380 + {
1.1381 + return
1.1382 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1383 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1384 + }
1.1385 + catch (Catch3& e)
1.1386 + {
1.1387 + return
1.1388 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1389 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1390 + }
1.1391 + catch (Catch4& e)
1.1392 + {
1.1393 + return
1.1394 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1395 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1396 + }
1.1397 + catch (Catch5& e)
1.1398 + {
1.1399 + return
1.1400 + detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1.1401 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1402 + }
1.1403 + catch (Catch6& e)
1.1404 + {
1.1405 + return
1.1406 + detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1.1407 + ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1408 + }
1.1409 + catch (...)
1.1410 + {
1.1411 + return
1.1412 + detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1.1413 + ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS);
1.1414 + }
1.1415 + }
1.1416 +};
1.1417 +
1.1418 +// 8 catch types case
1.1419 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1.1420 + class Catch7, class Catch8>
1.1421 +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>,
1.1422 + detail::catch_block<Catch7>, detail::catch_block<Catch8> > > >, Args> {
1.1423 +public:
1.1424 + Args args;
1.1425 +public:
1.1426 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1427 +
1.1428 + template <class SigArgs> struct sig {
1.1429 + typedef typename
1.1430 + as_lambda_functor<
1.1431 + typename boost::tuples::element<0, Args>::type
1.1432 + >::type lf_type;
1.1433 +
1.1434 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1435 + };
1.1436 +
1.1437 + template<class RET, CALL_TEMPLATE_ARGS>
1.1438 + RET call(CALL_FORMAL_ARGS) const {
1.1439 + try
1.1440 + {
1.1441 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1442 + }
1.1443 + catch (Catch1& e)
1.1444 + {
1.1445 + return
1.1446 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1447 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1448 + }
1.1449 + catch (Catch2& e)
1.1450 + {
1.1451 + return
1.1452 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1453 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1454 + }
1.1455 + catch (Catch3& e)
1.1456 + {
1.1457 + return
1.1458 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1459 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1460 + }
1.1461 + catch (Catch4& e)
1.1462 + {
1.1463 + return
1.1464 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1465 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1466 + }
1.1467 + catch (Catch5& e)
1.1468 + {
1.1469 + return
1.1470 + detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1.1471 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1472 + }
1.1473 + catch (Catch6& e)
1.1474 + {
1.1475 + return
1.1476 + detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1.1477 + ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1478 + }
1.1479 + catch (Catch7& e)
1.1480 + {
1.1481 + return
1.1482 + detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1.1483 + ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1484 + }
1.1485 + catch (Catch8& e)
1.1486 + {
1.1487 + return
1.1488 + detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
1.1489 + ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1490 + }
1.1491 + }
1.1492 +};
1.1493 +
1.1494 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1.1495 + class Catch7>
1.1496 +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>,
1.1497 + detail::catch_block<Catch7>,detail::catch_all_block> > >, Args> {
1.1498 +public:
1.1499 + Args args;
1.1500 +public:
1.1501 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1502 +
1.1503 + template <class SigArgs> struct sig {
1.1504 + typedef typename
1.1505 + as_lambda_functor<
1.1506 + typename boost::tuples::element<0, Args>::type
1.1507 + >::type lf_type;
1.1508 +
1.1509 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1510 + };
1.1511 +
1.1512 + template<class RET, CALL_TEMPLATE_ARGS>
1.1513 + RET call(CALL_FORMAL_ARGS) const {
1.1514 + try
1.1515 + {
1.1516 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1517 + }
1.1518 + catch (Catch1& e)
1.1519 + {
1.1520 + return
1.1521 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1522 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1523 + }
1.1524 + catch (Catch2& e)
1.1525 + {
1.1526 + return
1.1527 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1528 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1529 + }
1.1530 + catch (Catch3& e)
1.1531 + {
1.1532 + return
1.1533 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1534 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1535 + }
1.1536 + catch (Catch4& e)
1.1537 + {
1.1538 + return
1.1539 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1540 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1541 + }
1.1542 + catch (Catch5& e)
1.1543 + {
1.1544 + return
1.1545 + detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1.1546 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1547 + }
1.1548 + catch (Catch6& e)
1.1549 + {
1.1550 + return
1.1551 + detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1.1552 + ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1553 + }
1.1554 + catch (Catch7& e)
1.1555 + {
1.1556 + return
1.1557 + detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1.1558 + ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1559 + }
1.1560 + catch (...)
1.1561 + {
1.1562 + return
1.1563 + detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
1.1564 + ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS);
1.1565 + }
1.1566 + }
1.1567 +};
1.1568 +
1.1569 +// 9 catch types case
1.1570 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1.1571 + class Catch7, class Catch8, class Catch9>
1.1572 +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>,
1.1573 + detail::catch_block<Catch7>, detail::catch_block<Catch8>, detail::catch_block<Catch9> > > >, Args> {
1.1574 +public:
1.1575 + Args args;
1.1576 +public:
1.1577 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1578 +
1.1579 + template <class SigArgs> struct sig {
1.1580 + typedef typename
1.1581 + as_lambda_functor<
1.1582 + typename boost::tuples::element<0, Args>::type
1.1583 + >::type lf_type;
1.1584 +
1.1585 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1586 + };
1.1587 +
1.1588 + template<class RET, CALL_TEMPLATE_ARGS>
1.1589 + RET call(CALL_FORMAL_ARGS) const {
1.1590 + try
1.1591 + {
1.1592 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1593 + }
1.1594 + catch (Catch1& e)
1.1595 + {
1.1596 + return
1.1597 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1598 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1599 + }
1.1600 + catch (Catch2& e)
1.1601 + {
1.1602 + return
1.1603 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1604 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1605 + }
1.1606 + catch (Catch3& e)
1.1607 + {
1.1608 + return
1.1609 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1610 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1611 + }
1.1612 + catch (Catch4& e)
1.1613 + {
1.1614 + return
1.1615 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1616 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1617 + }
1.1618 + catch (Catch5& e)
1.1619 + {
1.1620 + return
1.1621 + detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1.1622 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1623 + }
1.1624 + catch (Catch6& e)
1.1625 + {
1.1626 + return
1.1627 + detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1.1628 + ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1629 + }
1.1630 + catch (Catch7& e)
1.1631 + {
1.1632 + return
1.1633 + detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1.1634 + ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1635 + }
1.1636 + catch (Catch8& e)
1.1637 + {
1.1638 + return
1.1639 + detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
1.1640 + ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1641 + }
1.1642 + catch (Catch9& e)
1.1643 + {
1.1644 + return
1.1645 + detail::return_or_throw<RET, typename ::boost::tuples::element<9, Args>::type>
1.1646 + ::call(::boost::tuples::get<9>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1647 + }
1.1648 + }
1.1649 +};
1.1650 +
1.1651 +template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
1.1652 + class Catch7, class Catch8>
1.1653 +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>,
1.1654 + detail::catch_block<Catch7>, detail::catch_block<Catch8>,detail::catch_all_block> > >, Args> {
1.1655 +public:
1.1656 + Args args;
1.1657 +public:
1.1658 + explicit lambda_functor_base(const Args& a) : args(a) {}
1.1659 +
1.1660 + template <class SigArgs> struct sig {
1.1661 + typedef typename
1.1662 + as_lambda_functor<
1.1663 + typename boost::tuples::element<0, Args>::type
1.1664 + >::type lf_type;
1.1665 +
1.1666 + typedef typename lf_type::inherited::template sig<SigArgs>::type type;
1.1667 + };
1.1668 +
1.1669 + template<class RET, CALL_TEMPLATE_ARGS>
1.1670 + RET call(CALL_FORMAL_ARGS) const {
1.1671 + try
1.1672 + {
1.1673 + return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
1.1674 + }
1.1675 + catch (Catch1& e)
1.1676 + {
1.1677 + return
1.1678 + detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
1.1679 + ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1680 + }
1.1681 + catch (Catch2& e)
1.1682 + {
1.1683 + return
1.1684 + detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
1.1685 + ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1686 + }
1.1687 + catch (Catch3& e)
1.1688 + {
1.1689 + return
1.1690 + detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
1.1691 + ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1692 + }
1.1693 + catch (Catch4& e)
1.1694 + {
1.1695 + return
1.1696 + detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
1.1697 + ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1698 + }
1.1699 + catch (Catch5& e)
1.1700 + {
1.1701 + return
1.1702 + detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
1.1703 + ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1704 + }
1.1705 + catch (Catch6& e)
1.1706 + {
1.1707 + return
1.1708 + detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
1.1709 + ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1710 + }
1.1711 + catch (Catch7& e)
1.1712 + {
1.1713 + return
1.1714 + detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
1.1715 + ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1716 + }
1.1717 + catch (Catch8& e)
1.1718 + {
1.1719 + return
1.1720 + detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
1.1721 + ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
1.1722 + }
1.1723 + catch (...)
1.1724 + {
1.1725 + return
1.1726 + detail::return_or_throw<RET, typename ::boost::tuples::element<9, Args>::type>
1.1727 + ::call(::boost::tuples::get<9>(args), CALL_ACTUAL_ARGS);
1.1728 + }
1.1729 + }
1.1730 +};
1.1731 +
1.1732 +
1.1733 +} // namespace lambda
1.1734 +} // namespace boost
1.1735 +
1.1736 +
1.1737 +#endif
1.1738 +
1.1739 +
1.1740 +
1.1741 +
1.1742 +
1.1743 +