Chris@16
|
1 // -- Boost Lambda Library -- exceptions.hpp ----------------
|
Chris@16
|
2 //
|
Chris@16
|
3 // Copyright (C) 2000 Gary Powell (gwpowell@hotmail.com)
|
Chris@16
|
4 // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
Chris@16
|
5 //
|
Chris@16
|
6 // Distributed under the Boost Software License, Version 1.0. (See
|
Chris@16
|
7 // accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
8 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
9 //
|
Chris@16
|
10 // For more information, see http://www.boost.org
|
Chris@16
|
11
|
Chris@16
|
12 // -----------------------------------------------------
|
Chris@16
|
13
|
Chris@16
|
14 #if !defined(BOOST_LAMBDA_EXCEPTIONS_HPP)
|
Chris@16
|
15 #define BOOST_LAMBDA_EXCEPTIONS_HPP
|
Chris@16
|
16
|
Chris@16
|
17 #include "boost/lambda/core.hpp"
|
Chris@16
|
18 #include "boost/lambda/detail/control_constructs_common.hpp"
|
Chris@16
|
19
|
Chris@16
|
20 namespace boost {
|
Chris@16
|
21 namespace lambda {
|
Chris@16
|
22
|
Chris@16
|
23 typedef lambda_functor<placeholder<EXCEPTION> > placeholderE_type;
|
Chris@16
|
24
|
Chris@16
|
25 namespace {
|
Chris@16
|
26 boost::lambda::placeholderE_type freeE;
|
Chris@16
|
27 boost::lambda::placeholderE_type& _e = freeE;
|
Chris@16
|
28 }
|
Chris@16
|
29
|
Chris@16
|
30 // -- exception related actions -------------------
|
Chris@16
|
31
|
Chris@16
|
32 // catch actions.
|
Chris@16
|
33 template <class Catch1, class Catch2 = null_type, class Catch3 = null_type,
|
Chris@16
|
34 class Catch4 = null_type, class Catch5 = null_type,
|
Chris@16
|
35 class Catch6 = null_type, class Catch7 = null_type,
|
Chris@16
|
36 class Catch8 = null_type, class Catch9 = null_type,
|
Chris@16
|
37 class Catch10 = null_type>
|
Chris@16
|
38 struct catch_action {};
|
Chris@16
|
39
|
Chris@16
|
40 struct catch_all_action {};
|
Chris@16
|
41
|
Chris@16
|
42 template<class CatchActions>
|
Chris@16
|
43 struct return_try_catch_action {};
|
Chris@16
|
44
|
Chris@16
|
45 template<class CatchActions>
|
Chris@16
|
46 struct try_catch_action {};
|
Chris@16
|
47
|
Chris@16
|
48 // rethrow actions
|
Chris@16
|
49 struct throw_new_action {};
|
Chris@16
|
50 struct rethrow_action {};
|
Chris@16
|
51
|
Chris@16
|
52 template<class ThrowType> struct throw_action;
|
Chris@16
|
53
|
Chris@16
|
54 template<>
|
Chris@16
|
55 struct throw_action<rethrow_action> {
|
Chris@16
|
56 template<class RET>
|
Chris@16
|
57 static RET apply() {
|
Chris@16
|
58 throw;
|
Chris@16
|
59 }
|
Chris@16
|
60 };
|
Chris@16
|
61
|
Chris@16
|
62 template<> struct throw_action<throw_new_action> {
|
Chris@16
|
63 template<class RET, class T>
|
Chris@16
|
64 static RET apply(T& t) {
|
Chris@16
|
65 throw t;
|
Chris@16
|
66 }
|
Chris@16
|
67 };
|
Chris@16
|
68
|
Chris@16
|
69 // return types for throw_actions --------------------------------------------
|
Chris@16
|
70
|
Chris@16
|
71 template<class T, class Any>
|
Chris@16
|
72 struct
|
Chris@16
|
73 return_type_N<throw_action<T>, Any> {
|
Chris@16
|
74 typedef void type;
|
Chris@16
|
75 };
|
Chris@16
|
76
|
Chris@16
|
77
|
Chris@16
|
78 // return types deductions -------------------------------------------------
|
Chris@16
|
79
|
Chris@16
|
80 // the return type of try_catch is the return type of the try lambda_functor
|
Chris@16
|
81 // (the return types of try and catch parts must match unless try returns void
|
Chris@16
|
82 // or the catch part throws for sure)
|
Chris@16
|
83
|
Chris@16
|
84 // NOTE, the exception placeholder deduction rule is defined
|
Chris@16
|
85 // in return_type_traits.hpp
|
Chris@16
|
86
|
Chris@16
|
87
|
Chris@16
|
88
|
Chris@16
|
89 // defined in control_constructs
|
Chris@16
|
90 class ifthenelse_action;
|
Chris@16
|
91
|
Chris@16
|
92 namespace detail {
|
Chris@16
|
93
|
Chris@16
|
94 // Templates for deducing, wether a lambda_functor throws inevitably of not -
|
Chris@16
|
95 // This mechanism is needed to make the compiler happy about
|
Chris@16
|
96 // return types of try and catch parts.
|
Chris@16
|
97
|
Chris@16
|
98 // a lambda_functor throws for sure if:
|
Chris@16
|
99 // - it is a throw expression
|
Chris@16
|
100 // - it is a comma expression, and one of its arguments throws for sure
|
Chris@16
|
101 // - it is an if_then_else expression and either the if statement or both
|
Chris@16
|
102 // the then and else throw.
|
Chris@16
|
103 // (there are other cases as well, but we do not cover them)
|
Chris@16
|
104 // e.g. _1 + (rethrow(), 3) does throw for sure but this is not checked
|
Chris@16
|
105 // This implies, that in such a case, the return types of try and catch parts
|
Chris@16
|
106 // must match if the try part returns other than void.
|
Chris@16
|
107 // (Such checks could be done though)
|
Chris@16
|
108
|
Chris@16
|
109 template <class Arg>
|
Chris@16
|
110 struct throws_for_sure_phase2 {
|
Chris@16
|
111 static const bool value = false;
|
Chris@16
|
112 };
|
Chris@16
|
113
|
Chris@16
|
114 template <int N, class ThrowType, class Args>
|
Chris@16
|
115 struct throws_for_sure_phase2<
|
Chris@16
|
116 lambda_functor<
|
Chris@16
|
117 lambda_functor_base<action<N, throw_action<ThrowType> >, Args>
|
Chris@16
|
118 >
|
Chris@16
|
119 >
|
Chris@16
|
120 {
|
Chris@16
|
121 static const bool value = true;
|
Chris@16
|
122 };
|
Chris@16
|
123
|
Chris@16
|
124 // Both then and else or the if throw of an if_then_else.
|
Chris@16
|
125 template <class Args>
|
Chris@16
|
126 struct throws_for_sure_phase2<
|
Chris@16
|
127 lambda_functor<
|
Chris@16
|
128 lambda_functor_base<
|
Chris@16
|
129 ifthenelse_action, Args
|
Chris@16
|
130 >
|
Chris@16
|
131 >
|
Chris@16
|
132 >
|
Chris@16
|
133 {
|
Chris@16
|
134 static const bool value =
|
Chris@16
|
135 throws_for_sure_phase2<
|
Chris@16
|
136 typename boost::tuples::element<0, Args>::type>::value
|
Chris@16
|
137 ||
|
Chris@16
|
138 (
|
Chris@16
|
139 throws_for_sure_phase2<
|
Chris@16
|
140 typename boost::tuples::element<1, Args>::type
|
Chris@16
|
141 >::value
|
Chris@16
|
142 &&
|
Chris@16
|
143 throws_for_sure_phase2<
|
Chris@16
|
144 typename boost::tuples::element<2, Args>::type
|
Chris@16
|
145 >::value
|
Chris@16
|
146 );
|
Chris@16
|
147 };
|
Chris@16
|
148
|
Chris@16
|
149 template <class Args>
|
Chris@16
|
150 struct throws_for_sure_phase2<
|
Chris@16
|
151 lambda_functor<
|
Chris@16
|
152 lambda_functor_base< other_action<comma_action>, Args>
|
Chris@16
|
153 >
|
Chris@16
|
154 >
|
Chris@16
|
155 {
|
Chris@16
|
156 static const bool value =
|
Chris@16
|
157 throws_for_sure_phase2<
|
Chris@16
|
158 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
159 >::value
|
Chris@16
|
160 ||
|
Chris@16
|
161 throws_for_sure_phase2<
|
Chris@16
|
162 typename boost::tuples::element<1, Args>::type
|
Chris@16
|
163 >::value;
|
Chris@16
|
164 };
|
Chris@16
|
165
|
Chris@16
|
166 // get rid of any qualifiers and references
|
Chris@16
|
167 // lambda_functors should be stored like that, so this is to be extra sure
|
Chris@16
|
168 template <class Arg>
|
Chris@16
|
169 struct throws_for_sure {
|
Chris@16
|
170 static const bool value
|
Chris@16
|
171 = throws_for_sure_phase2<
|
Chris@16
|
172 typename detail::remove_reference_and_cv<Arg>::type
|
Chris@16
|
173 >::value;
|
Chris@16
|
174 };
|
Chris@16
|
175
|
Chris@16
|
176
|
Chris@16
|
177 // -- return_or_throw templates -----------------------------
|
Chris@16
|
178
|
Chris@16
|
179 // false case, catch and try return types are incompatible
|
Chris@16
|
180 // Now the catch part must throw for sure, otherwise a compile time error
|
Chris@16
|
181 // occurs.
|
Chris@16
|
182 template<bool is_conversion>
|
Chris@16
|
183 struct return_or_throw_phase2 {
|
Chris@16
|
184 template<class RET, class Arg, CALL_TEMPLATE_ARGS>
|
Chris@16
|
185 static RET call(Arg& arg, CALL_FORMAL_ARGS) {
|
Chris@16
|
186 BOOST_STATIC_ASSERT(throws_for_sure<Arg>::value);
|
Chris@16
|
187 detail::select(arg, CALL_ACTUAL_ARGS); // this line throws
|
Chris@16
|
188 throw 1; // this line is never performed, hence 1 is just a dummy
|
Chris@16
|
189 // The line is needed to make compiler happy and not require
|
Chris@16
|
190 // a matching return type
|
Chris@16
|
191 }
|
Chris@16
|
192 };
|
Chris@16
|
193
|
Chris@16
|
194 // the try and catch return types are compatible
|
Chris@16
|
195 template<>
|
Chris@16
|
196 struct return_or_throw_phase2<true> {
|
Chris@16
|
197 template<class RET, class Arg, CALL_TEMPLATE_ARGS>
|
Chris@16
|
198 static RET call(Arg& arg, CALL_FORMAL_ARGS) {
|
Chris@16
|
199 return detail::select(arg, CALL_ACTUAL_ARGS);
|
Chris@16
|
200 }
|
Chris@16
|
201 };
|
Chris@16
|
202
|
Chris@16
|
203
|
Chris@16
|
204 // the non-void case. Try part returns a value, so catch parts must
|
Chris@16
|
205 // return a value of the same type or throw
|
Chris@16
|
206 template<class RET, class ARG>
|
Chris@16
|
207 struct return_or_throw {
|
Chris@16
|
208 // Arg should be equal to ARG except that ARG may be a reference
|
Chris@16
|
209 // to be sure, that there are no suprises for peculiarly defined return types
|
Chris@16
|
210 // ARG is passed explicitely
|
Chris@16
|
211 template<class Arg, CALL_TEMPLATE_ARGS>
|
Chris@16
|
212 static RET call(Arg& arg, CALL_FORMAL_ARGS)
|
Chris@16
|
213 {
|
Chris@16
|
214 // typedef typename Arg::return_type<ARG, open_args<A&, B&, C&> >::type RT;
|
Chris@16
|
215 typedef typename as_lambda_functor<ARG>::type lf_type;
|
Chris@16
|
216 typedef typename lf_type::inherited::template
|
Chris@16
|
217 sig<tuple<CALL_REFERENCE_TYPES> >::type RT;
|
Chris@16
|
218
|
Chris@16
|
219 return
|
Chris@16
|
220 return_or_throw_phase2<
|
Chris@16
|
221 ::boost::is_convertible<RT, RET>::value
|
Chris@16
|
222 >::template call<RET>(arg, CALL_ACTUAL_ARGS);
|
Chris@16
|
223 }
|
Chris@16
|
224 };
|
Chris@16
|
225
|
Chris@16
|
226 // if try part returns void, we do not return the catch parts either
|
Chris@16
|
227 template<class ARG>
|
Chris@16
|
228 struct return_or_throw<void, ARG> {
|
Chris@16
|
229 template<class Arg, CALL_TEMPLATE_ARGS>
|
Chris@16
|
230 static void call(Arg& arg, CALL_FORMAL_ARGS) { detail::select(arg, CALL_ACTUAL_ARGS); }
|
Chris@16
|
231 };
|
Chris@16
|
232
|
Chris@16
|
233 } // end detail
|
Chris@16
|
234
|
Chris@16
|
235 // Throwing exceptions ---------------------------------------------
|
Chris@16
|
236
|
Chris@16
|
237 namespace detail {
|
Chris@16
|
238
|
Chris@16
|
239 template <class T> struct catch_block {};
|
Chris@16
|
240 struct catch_all_block {};
|
Chris@16
|
241
|
Chris@16
|
242 template <class T> struct exception_catch_tag {};
|
Chris@16
|
243
|
Chris@16
|
244 // normal catch block is represented as
|
Chris@16
|
245 // tagged_lambda_functor<exception_catch_tag<catch_type<T> > >, LambdaFunctor>
|
Chris@16
|
246
|
Chris@16
|
247 // the default catch all block as:
|
Chris@16
|
248 // tagged_lambda_functor<exception_catch_tag<catch_all_block> >, LambdaFunctor>
|
Chris@16
|
249
|
Chris@16
|
250
|
Chris@16
|
251 } // end detail
|
Chris@16
|
252
|
Chris@16
|
253 // the code is RETHROW, this ensures that a compile time error results,
|
Chris@16
|
254 // if this lambda_functor is used outside a delayed catch_expression
|
Chris@16
|
255 inline const
|
Chris@16
|
256 lambda_functor<
|
Chris@16
|
257 lambda_functor_base<
|
Chris@16
|
258 action<0, throw_action<rethrow_action> >,
|
Chris@16
|
259 null_type
|
Chris@16
|
260 >
|
Chris@16
|
261 >
|
Chris@16
|
262 rethrow() {
|
Chris@16
|
263 return
|
Chris@16
|
264 lambda_functor_base<
|
Chris@16
|
265 action<0, throw_action<rethrow_action> >,
|
Chris@16
|
266 null_type
|
Chris@16
|
267 >
|
Chris@16
|
268 ( null_type() );
|
Chris@16
|
269 }
|
Chris@16
|
270
|
Chris@16
|
271 template <class Arg1>
|
Chris@16
|
272 inline const
|
Chris@16
|
273 lambda_functor<
|
Chris@16
|
274 lambda_functor_base<
|
Chris@16
|
275 action<1, throw_action<throw_new_action> >,
|
Chris@16
|
276 tuple<typename const_copy_argument<const Arg1>::type>
|
Chris@16
|
277 >
|
Chris@16
|
278 >
|
Chris@16
|
279 throw_exception(const Arg1& a1) {
|
Chris@16
|
280 return
|
Chris@16
|
281 lambda_functor_base<
|
Chris@16
|
282 action<1, throw_action<throw_new_action> >,
|
Chris@16
|
283 tuple<typename const_copy_argument<const Arg1>::type>
|
Chris@16
|
284 >
|
Chris@16
|
285 ( tuple<typename const_copy_argument<const Arg1>::type>(a1));
|
Chris@16
|
286 }
|
Chris@16
|
287
|
Chris@16
|
288 // create catch blocks
|
Chris@16
|
289 template <class CatchType, class Arg>
|
Chris@16
|
290 inline const
|
Chris@16
|
291 tagged_lambda_functor<
|
Chris@16
|
292 detail::exception_catch_tag<detail::catch_block<CatchType> >,
|
Chris@16
|
293 lambda_functor<Arg>
|
Chris@16
|
294 >
|
Chris@16
|
295 catch_exception(const lambda_functor<Arg>& a) {
|
Chris@16
|
296 // the third placeholder cannot be used in catch_exception
|
Chris@16
|
297 // BOOST_STATIC_ASSERT((!has_placeholder<Arg, THIRD>::value));
|
Chris@16
|
298 return
|
Chris@16
|
299 tagged_lambda_functor<
|
Chris@16
|
300 detail::exception_catch_tag<detail::catch_block<CatchType> >,
|
Chris@16
|
301 lambda_functor<Arg>
|
Chris@16
|
302 > (a);
|
Chris@16
|
303 }
|
Chris@16
|
304
|
Chris@16
|
305 // catch and do nothing case.
|
Chris@16
|
306 template <class CatchType>
|
Chris@16
|
307 inline const
|
Chris@16
|
308 tagged_lambda_functor<
|
Chris@16
|
309 detail::exception_catch_tag<detail::catch_block<CatchType> >,
|
Chris@16
|
310 lambda_functor<
|
Chris@16
|
311 lambda_functor_base<
|
Chris@16
|
312 do_nothing_action,
|
Chris@16
|
313 null_type
|
Chris@16
|
314 >
|
Chris@16
|
315 >
|
Chris@16
|
316 >
|
Chris@16
|
317 catch_exception() {
|
Chris@16
|
318 return
|
Chris@16
|
319 tagged_lambda_functor<
|
Chris@16
|
320 detail::exception_catch_tag<detail::catch_block<CatchType> >,
|
Chris@16
|
321 lambda_functor<
|
Chris@16
|
322 lambda_functor_base<
|
Chris@16
|
323 do_nothing_action,
|
Chris@16
|
324 null_type
|
Chris@16
|
325 >
|
Chris@16
|
326 >
|
Chris@16
|
327 > ();
|
Chris@16
|
328 }
|
Chris@16
|
329
|
Chris@16
|
330 // create catch(...) blocks
|
Chris@16
|
331 template <class Arg>
|
Chris@16
|
332 inline const
|
Chris@16
|
333 tagged_lambda_functor<
|
Chris@16
|
334 detail::exception_catch_tag<detail::catch_all_block>,
|
Chris@16
|
335 lambda_functor<Arg>
|
Chris@16
|
336 >
|
Chris@16
|
337 catch_all(const lambda_functor<Arg>& a) {
|
Chris@16
|
338 // the third placeholder cannot be used in catch_exception
|
Chris@16
|
339 BOOST_STATIC_ASSERT((!has_placeholder<Arg, THIRD>::value));
|
Chris@16
|
340 return
|
Chris@16
|
341 tagged_lambda_functor<
|
Chris@16
|
342 detail::exception_catch_tag<detail::catch_all_block>,
|
Chris@16
|
343 lambda_functor<Arg>
|
Chris@16
|
344 > (a);
|
Chris@16
|
345 }
|
Chris@16
|
346
|
Chris@16
|
347 // catch(...) and do nothing case.
|
Chris@16
|
348 inline const
|
Chris@16
|
349 tagged_lambda_functor<
|
Chris@16
|
350 detail::exception_catch_tag<detail::catch_all_block>,
|
Chris@16
|
351 lambda_functor<
|
Chris@16
|
352 lambda_functor_base<
|
Chris@16
|
353 do_nothing_action,
|
Chris@16
|
354 null_type
|
Chris@16
|
355 >
|
Chris@16
|
356 >
|
Chris@16
|
357 >
|
Chris@16
|
358 catch_all() {
|
Chris@16
|
359 return
|
Chris@16
|
360 tagged_lambda_functor<
|
Chris@16
|
361 detail::exception_catch_tag<detail::catch_all_block>,
|
Chris@16
|
362 lambda_functor<
|
Chris@16
|
363 lambda_functor_base<
|
Chris@16
|
364 do_nothing_action,
|
Chris@16
|
365 null_type
|
Chris@16
|
366 >
|
Chris@16
|
367 >
|
Chris@16
|
368 > ();
|
Chris@16
|
369 }
|
Chris@16
|
370
|
Chris@16
|
371 // try_catch functions --------------------------------
|
Chris@16
|
372 // The second -> N argument(s) are must be catch lambda_functors
|
Chris@16
|
373 template <class TryArg, class Catch1, class LF1>
|
Chris@16
|
374 inline const
|
Chris@16
|
375 lambda_functor<
|
Chris@16
|
376 lambda_functor_base<
|
Chris@16
|
377 action<2, try_catch_action<catch_action<Catch1> > >,
|
Chris@16
|
378 tuple<lambda_functor<TryArg>, LF1>
|
Chris@16
|
379 >
|
Chris@16
|
380 >
|
Chris@16
|
381 try_catch(
|
Chris@16
|
382 const lambda_functor<TryArg>& a1,
|
Chris@16
|
383 const tagged_lambda_functor<detail::exception_catch_tag<Catch1>, LF1>& a2)
|
Chris@16
|
384 {
|
Chris@16
|
385 return
|
Chris@16
|
386 lambda_functor_base<
|
Chris@16
|
387 action<2, try_catch_action<catch_action<Catch1> > >,
|
Chris@16
|
388 tuple<lambda_functor<TryArg>, LF1>
|
Chris@16
|
389 >
|
Chris@16
|
390 ( tuple< lambda_functor<TryArg>, LF1>(a1, a2));
|
Chris@16
|
391 }
|
Chris@16
|
392
|
Chris@16
|
393 template <class TryArg, class Catch1, class LF1,
|
Chris@16
|
394 class Catch2, class LF2>
|
Chris@16
|
395 inline const
|
Chris@16
|
396 lambda_functor<
|
Chris@16
|
397 lambda_functor_base<
|
Chris@16
|
398 action<3, try_catch_action<catch_action<detail::catch_block<Catch1>, Catch2> > >,
|
Chris@16
|
399 tuple<lambda_functor<TryArg>, LF1, LF2>
|
Chris@16
|
400 >
|
Chris@16
|
401 >
|
Chris@16
|
402 try_catch(
|
Chris@16
|
403 const lambda_functor<TryArg>& a1,
|
Chris@16
|
404 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
|
Chris@16
|
405 const tagged_lambda_functor<detail::exception_catch_tag<Catch2>, LF2>& a3)
|
Chris@16
|
406 {
|
Chris@16
|
407 return
|
Chris@16
|
408 lambda_functor_base<
|
Chris@16
|
409 action<3, try_catch_action<catch_action<detail::catch_block<Catch1>, Catch2> > >,
|
Chris@16
|
410 tuple<lambda_functor<TryArg>, LF1, LF2>
|
Chris@16
|
411 >
|
Chris@16
|
412 ( tuple<lambda_functor<TryArg>, LF1, LF2>(a1, a2, a3));
|
Chris@16
|
413 }
|
Chris@16
|
414
|
Chris@16
|
415 template <class TryArg, class Catch1, class LF1,
|
Chris@16
|
416 class Catch2, class LF2,
|
Chris@16
|
417 class Catch3, class LF3>
|
Chris@16
|
418 inline const lambda_functor<
|
Chris@16
|
419 lambda_functor_base<
|
Chris@16
|
420 action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, Catch3> > >,
|
Chris@16
|
421 tuple<lambda_functor<TryArg>, LF1, LF2, LF3>
|
Chris@16
|
422 >
|
Chris@16
|
423 >
|
Chris@16
|
424 try_catch(
|
Chris@16
|
425 const lambda_functor<TryArg>& a1,
|
Chris@16
|
426 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
|
Chris@16
|
427 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
|
Chris@16
|
428 const tagged_lambda_functor<detail::exception_catch_tag<Catch3>, LF3>& a4)
|
Chris@16
|
429 {
|
Chris@16
|
430 return
|
Chris@16
|
431 lambda_functor_base<
|
Chris@16
|
432 action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, Catch3> > >,
|
Chris@16
|
433 tuple<lambda_functor<TryArg>, LF1, LF2, LF3>
|
Chris@16
|
434 >
|
Chris@16
|
435 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3>(a1, a2, a3, a4));
|
Chris@16
|
436 }
|
Chris@16
|
437
|
Chris@16
|
438 template <class TryArg, class Catch1, class LF1,
|
Chris@16
|
439 class Catch2, class LF2,
|
Chris@16
|
440 class Catch3, class LF3,
|
Chris@16
|
441 class Catch4, class LF4>
|
Chris@16
|
442 inline const
|
Chris@16
|
443 lambda_functor<
|
Chris@16
|
444 lambda_functor_base<
|
Chris@16
|
445 action<
|
Chris@16
|
446 5,
|
Chris@16
|
447 try_catch_action<
|
Chris@16
|
448 catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, Catch4>
|
Chris@16
|
449 >
|
Chris@16
|
450 >,
|
Chris@16
|
451 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4>
|
Chris@16
|
452 >
|
Chris@16
|
453 >
|
Chris@16
|
454 try_catch(
|
Chris@16
|
455 const lambda_functor<TryArg>& a1,
|
Chris@16
|
456 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
|
Chris@16
|
457 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
|
Chris@16
|
458 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
|
Chris@16
|
459 const tagged_lambda_functor<detail::exception_catch_tag<Catch4>, LF4>& a5)
|
Chris@16
|
460 {
|
Chris@16
|
461 return
|
Chris@16
|
462 lambda_functor_base<
|
Chris@16
|
463 action<
|
Chris@16
|
464 5,
|
Chris@16
|
465 try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, Catch4> >
|
Chris@16
|
466 >,
|
Chris@16
|
467 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4>
|
Chris@16
|
468 >
|
Chris@16
|
469 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4>(a1, a2, a3, a4, a5));
|
Chris@16
|
470 }
|
Chris@16
|
471
|
Chris@16
|
472 template <class TryArg, class Catch1, class LF1,
|
Chris@16
|
473 class Catch2, class LF2,
|
Chris@16
|
474 class Catch3, class LF3,
|
Chris@16
|
475 class Catch4, class LF4,
|
Chris@16
|
476 class Catch5, class LF5>
|
Chris@16
|
477 inline const
|
Chris@16
|
478 lambda_functor<
|
Chris@16
|
479 lambda_functor_base<
|
Chris@16
|
480 action<
|
Chris@16
|
481 6,
|
Chris@16
|
482 try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, Catch5> >
|
Chris@16
|
483 >,
|
Chris@16
|
484 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5>
|
Chris@16
|
485 >
|
Chris@16
|
486 >
|
Chris@16
|
487 try_catch(
|
Chris@16
|
488 const lambda_functor<TryArg>& a1,
|
Chris@16
|
489 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
|
Chris@16
|
490 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
|
Chris@16
|
491 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
|
Chris@16
|
492 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
|
Chris@16
|
493 const tagged_lambda_functor<detail::exception_catch_tag<Catch5>, LF5>& a6)
|
Chris@16
|
494 {
|
Chris@16
|
495 return
|
Chris@16
|
496 lambda_functor_base<
|
Chris@16
|
497 action<
|
Chris@16
|
498 6,
|
Chris@16
|
499 try_catch_action<
|
Chris@16
|
500 catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, Catch5>
|
Chris@16
|
501 >
|
Chris@16
|
502 >,
|
Chris@16
|
503 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5>
|
Chris@16
|
504 >
|
Chris@16
|
505 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5>
|
Chris@16
|
506 (a1, a2, a3, a4, a5, a6)
|
Chris@16
|
507 );
|
Chris@16
|
508 }
|
Chris@16
|
509
|
Chris@16
|
510 template <class TryArg, class Catch1, class LF1,
|
Chris@16
|
511 class Catch2, class LF2,
|
Chris@16
|
512 class Catch3, class LF3,
|
Chris@16
|
513 class Catch4, class LF4,
|
Chris@16
|
514 class Catch5, class LF5,
|
Chris@16
|
515 class Catch6, class LF6>
|
Chris@16
|
516 inline const
|
Chris@16
|
517 lambda_functor<
|
Chris@16
|
518 lambda_functor_base<
|
Chris@16
|
519 action<
|
Chris@16
|
520 7,
|
Chris@16
|
521 try_catch_action<
|
Chris@16
|
522 catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>, Catch6>
|
Chris@16
|
523 >
|
Chris@16
|
524 >,
|
Chris@16
|
525 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6>
|
Chris@16
|
526 >
|
Chris@16
|
527 >
|
Chris@16
|
528 try_catch(
|
Chris@16
|
529 const lambda_functor<TryArg>& a1,
|
Chris@16
|
530 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
|
Chris@16
|
531 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
|
Chris@16
|
532 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
|
Chris@16
|
533 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
|
Chris@16
|
534 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
|
Chris@16
|
535 const tagged_lambda_functor<detail::exception_catch_tag<Catch6>, LF6>& a7)
|
Chris@16
|
536 {
|
Chris@16
|
537 return
|
Chris@16
|
538 lambda_functor_base<
|
Chris@16
|
539 action<
|
Chris@16
|
540 7,
|
Chris@16
|
541 try_catch_action<
|
Chris@16
|
542 catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3>, detail::catch_block<Catch4>, detail::catch_block<Catch5>,Catch6>
|
Chris@16
|
543 >
|
Chris@16
|
544 >,
|
Chris@16
|
545 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6>
|
Chris@16
|
546 >
|
Chris@16
|
547 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6>
|
Chris@16
|
548 (a1, a2, a3, a4, a5, a6, a7));
|
Chris@16
|
549 }
|
Chris@16
|
550
|
Chris@16
|
551 template <class TryArg, class Catch1, class LF1,
|
Chris@16
|
552 class Catch2, class LF2,
|
Chris@16
|
553 class Catch3, class LF3,
|
Chris@16
|
554 class Catch4, class LF4,
|
Chris@16
|
555 class Catch5, class LF5,
|
Chris@16
|
556 class Catch6, class LF6,
|
Chris@16
|
557 class Catch7, class LF7>
|
Chris@16
|
558 inline const
|
Chris@16
|
559 lambda_functor<
|
Chris@16
|
560 lambda_functor_base<
|
Chris@16
|
561 action<
|
Chris@16
|
562 8,
|
Chris@16
|
563 try_catch_action<
|
Chris@16
|
564 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>
|
Chris@16
|
565 >
|
Chris@16
|
566 >,
|
Chris@16
|
567 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7>
|
Chris@16
|
568 >
|
Chris@16
|
569 >
|
Chris@16
|
570 try_catch(
|
Chris@16
|
571 const lambda_functor<TryArg>& a1,
|
Chris@16
|
572 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
|
Chris@16
|
573 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
|
Chris@16
|
574 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
|
Chris@16
|
575 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
|
Chris@16
|
576 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
|
Chris@16
|
577 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch6> >, LF6>& a7,
|
Chris@16
|
578 const tagged_lambda_functor<detail::exception_catch_tag<Catch7>, LF7>& a8)
|
Chris@16
|
579 {
|
Chris@16
|
580 return
|
Chris@16
|
581 lambda_functor_base<
|
Chris@16
|
582 action<
|
Chris@16
|
583 8,
|
Chris@16
|
584 try_catch_action<
|
Chris@16
|
585 catch_action<
|
Chris@16
|
586 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
|
Chris@16
|
587 >
|
Chris@16
|
588 >
|
Chris@16
|
589 >,
|
Chris@16
|
590 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7>
|
Chris@16
|
591 >
|
Chris@16
|
592 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7>
|
Chris@16
|
593 (a1, a2, a3, a4, a5, a6, a7, a8));
|
Chris@16
|
594 }
|
Chris@16
|
595
|
Chris@16
|
596 template <class TryArg, class Catch1, class LF1,
|
Chris@16
|
597 class Catch2, class LF2,
|
Chris@16
|
598 class Catch3, class LF3,
|
Chris@16
|
599 class Catch4, class LF4,
|
Chris@16
|
600 class Catch5, class LF5,
|
Chris@16
|
601 class Catch6, class LF6,
|
Chris@16
|
602 class Catch7, class LF7,
|
Chris@16
|
603 class Catch8, class LF8>
|
Chris@16
|
604 inline const
|
Chris@16
|
605 lambda_functor<
|
Chris@16
|
606 lambda_functor_base<
|
Chris@16
|
607 action<
|
Chris@16
|
608 9,
|
Chris@16
|
609 try_catch_action<
|
Chris@16
|
610 catch_action<
|
Chris@16
|
611 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
|
Chris@16
|
612 >
|
Chris@16
|
613 >
|
Chris@16
|
614 >,
|
Chris@16
|
615 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8>
|
Chris@16
|
616 >
|
Chris@16
|
617 >
|
Chris@16
|
618 try_catch(
|
Chris@16
|
619 const lambda_functor<TryArg>& a1,
|
Chris@16
|
620 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
|
Chris@16
|
621 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
|
Chris@16
|
622 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
|
Chris@16
|
623 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
|
Chris@16
|
624 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
|
Chris@16
|
625 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch6> >, LF6>& a7,
|
Chris@16
|
626 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch7> >, LF7>& a8,
|
Chris@16
|
627 const tagged_lambda_functor<detail::exception_catch_tag<Catch8>, LF8>& a9)
|
Chris@16
|
628 {
|
Chris@16
|
629 return
|
Chris@16
|
630 lambda_functor_base<
|
Chris@16
|
631 action<
|
Chris@16
|
632 9,
|
Chris@16
|
633 try_catch_action<
|
Chris@16
|
634 catch_action<
|
Chris@16
|
635 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
|
Chris@16
|
636 >
|
Chris@16
|
637 >
|
Chris@16
|
638 >,
|
Chris@16
|
639 tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8>
|
Chris@16
|
640 >
|
Chris@16
|
641 ( tuple<lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8>
|
Chris@16
|
642 (a1, a2, a3, a4, a5, a6, a7, a8, a9));
|
Chris@16
|
643 }
|
Chris@16
|
644
|
Chris@16
|
645 template <class TryArg, class Catch1, class LF1,
|
Chris@16
|
646 class Catch2, class LF2,
|
Chris@16
|
647 class Catch3, class LF3,
|
Chris@16
|
648 class Catch4, class LF4,
|
Chris@16
|
649 class Catch5, class LF5,
|
Chris@16
|
650 class Catch6, class LF6,
|
Chris@16
|
651 class Catch7, class LF7,
|
Chris@16
|
652 class Catch8, class LF8,
|
Chris@16
|
653 class Catch9, class LF9>
|
Chris@16
|
654 inline const
|
Chris@16
|
655 lambda_functor<
|
Chris@16
|
656 lambda_functor_base<
|
Chris@16
|
657 action<
|
Chris@16
|
658 10,
|
Chris@16
|
659 try_catch_action<
|
Chris@16
|
660 catch_action<
|
Chris@16
|
661 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>,
|
Chris@16
|
662 Catch9
|
Chris@16
|
663 >
|
Chris@16
|
664 >
|
Chris@16
|
665 >,
|
Chris@16
|
666 tuple<
|
Chris@16
|
667 lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9
|
Chris@16
|
668 >
|
Chris@16
|
669 >
|
Chris@16
|
670 >
|
Chris@16
|
671 try_catch(
|
Chris@16
|
672 const lambda_functor<TryArg>& a1,
|
Chris@16
|
673 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch1> >, LF1>& a2,
|
Chris@16
|
674 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch2> >, LF2>& a3,
|
Chris@16
|
675 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch3> >, LF3>& a4,
|
Chris@16
|
676 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch4> >, LF4>& a5,
|
Chris@16
|
677 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch5> >, LF5>& a6,
|
Chris@16
|
678 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch6> >, LF6>& a7,
|
Chris@16
|
679 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch7> >, LF7>& a8,
|
Chris@16
|
680 const tagged_lambda_functor<detail::exception_catch_tag<detail::catch_block<Catch8> >, LF8>& a9,
|
Chris@16
|
681 const tagged_lambda_functor<detail::exception_catch_tag<Catch9>, LF9>& a10)
|
Chris@16
|
682 {
|
Chris@16
|
683 return
|
Chris@16
|
684 lambda_functor_base<
|
Chris@16
|
685 action<
|
Chris@16
|
686 10,
|
Chris@16
|
687 try_catch_action<
|
Chris@16
|
688 catch_action<
|
Chris@16
|
689 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>,
|
Chris@16
|
690 Catch9
|
Chris@16
|
691 >
|
Chris@16
|
692 >
|
Chris@16
|
693 >,
|
Chris@16
|
694 tuple<
|
Chris@16
|
695 lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9
|
Chris@16
|
696 >
|
Chris@16
|
697 >
|
Chris@16
|
698 ( tuple<
|
Chris@16
|
699 lambda_functor<TryArg>, LF1, LF2, LF3, LF4, LF5, LF6, LF7, LF8, LF9
|
Chris@16
|
700 >(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10));
|
Chris@16
|
701 }
|
Chris@16
|
702
|
Chris@16
|
703
|
Chris@16
|
704 // ---------------------------------------------------------------------------
|
Chris@16
|
705 // Specializations for lambda_functor_base of try_catch ----------------------
|
Chris@16
|
706
|
Chris@16
|
707 // 1 catch type case
|
Chris@16
|
708
|
Chris@16
|
709 template<class Args, class Catch1>
|
Chris@16
|
710 class lambda_functor_base<
|
Chris@16
|
711 action<2, try_catch_action<catch_action<detail::catch_block<Catch1> > > >,
|
Chris@16
|
712 Args
|
Chris@16
|
713 >
|
Chris@16
|
714 {
|
Chris@16
|
715 public:
|
Chris@16
|
716 Args args;
|
Chris@16
|
717 public:
|
Chris@16
|
718 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
719
|
Chris@16
|
720 // the return type of try_catch is the return type of the try lambda_functor
|
Chris@16
|
721 // (the return types of try and catch parts must match unless try returns void
|
Chris@16
|
722 // or the catch part throws for sure)
|
Chris@16
|
723
|
Chris@16
|
724 template <class SigArgs> struct sig {
|
Chris@16
|
725 typedef typename
|
Chris@16
|
726 as_lambda_functor<
|
Chris@16
|
727 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
728 >::type lf_type;
|
Chris@16
|
729
|
Chris@16
|
730 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
731 };
|
Chris@16
|
732
|
Chris@16
|
733 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
734 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
735 try
|
Chris@16
|
736 {
|
Chris@16
|
737 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
738 }
|
Chris@16
|
739 catch (Catch1& e)
|
Chris@16
|
740 {
|
Chris@16
|
741 return
|
Chris@16
|
742 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
743 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
744 }
|
Chris@16
|
745 }
|
Chris@16
|
746 };
|
Chris@16
|
747
|
Chris@16
|
748
|
Chris@16
|
749
|
Chris@16
|
750 template<class Args>
|
Chris@16
|
751 class lambda_functor_base<action<2, try_catch_action<catch_action<detail::catch_all_block> > >, Args> {
|
Chris@16
|
752 public:
|
Chris@16
|
753 Args args;
|
Chris@16
|
754 public:
|
Chris@16
|
755 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
756
|
Chris@16
|
757 template <class SigArgs> struct sig {
|
Chris@16
|
758 typedef typename
|
Chris@16
|
759 as_lambda_functor<
|
Chris@16
|
760 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
761 >::type lf_type;
|
Chris@16
|
762
|
Chris@16
|
763 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
764 };
|
Chris@16
|
765
|
Chris@16
|
766 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
767 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
768 try
|
Chris@16
|
769 {
|
Chris@16
|
770 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
771 }
|
Chris@16
|
772 catch (...)
|
Chris@16
|
773 {
|
Chris@16
|
774 return
|
Chris@16
|
775 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
776 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
777 }
|
Chris@16
|
778 }
|
Chris@16
|
779 };
|
Chris@16
|
780
|
Chris@16
|
781
|
Chris@16
|
782 // 2 catch types case
|
Chris@16
|
783 template<class Args, class Catch1, class Catch2>
|
Chris@16
|
784 class lambda_functor_base<action<3, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2> > > >, Args> {
|
Chris@16
|
785 public:
|
Chris@16
|
786 Args args;
|
Chris@16
|
787 public:
|
Chris@16
|
788 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
789
|
Chris@16
|
790 template <class SigArgs> struct sig {
|
Chris@16
|
791 typedef typename
|
Chris@16
|
792 as_lambda_functor<
|
Chris@16
|
793 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
794 >::type lf_type;
|
Chris@16
|
795
|
Chris@16
|
796 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
797 };
|
Chris@16
|
798
|
Chris@16
|
799 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
800 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
801 try
|
Chris@16
|
802 {
|
Chris@16
|
803 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
804 }
|
Chris@16
|
805 catch (Catch1& e)
|
Chris@16
|
806 {
|
Chris@16
|
807 return
|
Chris@16
|
808 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
809 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
810 }
|
Chris@16
|
811 catch (Catch2& e)
|
Chris@16
|
812 {
|
Chris@16
|
813 return
|
Chris@16
|
814 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
815 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
816 }
|
Chris@16
|
817 }
|
Chris@16
|
818 };
|
Chris@16
|
819
|
Chris@16
|
820 template<class Args, class Catch1>
|
Chris@16
|
821 class lambda_functor_base<action<3, try_catch_action<catch_action<detail::catch_block<Catch1>,detail::catch_all_block> > >, Args> {
|
Chris@16
|
822 public:
|
Chris@16
|
823 Args args;
|
Chris@16
|
824 public:
|
Chris@16
|
825 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
826
|
Chris@16
|
827 template <class SigArgs> struct sig {
|
Chris@16
|
828 typedef typename
|
Chris@16
|
829 as_lambda_functor<
|
Chris@16
|
830 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
831 >::type lf_type;
|
Chris@16
|
832
|
Chris@16
|
833 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
834 };
|
Chris@16
|
835
|
Chris@16
|
836 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
837 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
838 try
|
Chris@16
|
839 {
|
Chris@16
|
840 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
841 }
|
Chris@16
|
842 catch (Catch1& e)
|
Chris@16
|
843 {
|
Chris@16
|
844 return
|
Chris@16
|
845 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
846 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
847 }
|
Chris@16
|
848 catch (...)
|
Chris@16
|
849 {
|
Chris@16
|
850 return
|
Chris@16
|
851 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
852 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
853 }
|
Chris@16
|
854 }
|
Chris@16
|
855 };
|
Chris@16
|
856
|
Chris@16
|
857 // 3 catch types case
|
Chris@16
|
858 template<class Args, class Catch1, class Catch2, class Catch3>
|
Chris@16
|
859 class lambda_functor_base<action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>, detail::catch_block<Catch3> > > >, Args> {
|
Chris@16
|
860 public:
|
Chris@16
|
861 Args args;
|
Chris@16
|
862 public:
|
Chris@16
|
863 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
864
|
Chris@16
|
865 template <class SigArgs> struct sig {
|
Chris@16
|
866 typedef typename
|
Chris@16
|
867 as_lambda_functor<
|
Chris@16
|
868 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
869 >::type lf_type;
|
Chris@16
|
870
|
Chris@16
|
871 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
872 };
|
Chris@16
|
873
|
Chris@16
|
874 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
875 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
876 try
|
Chris@16
|
877 {
|
Chris@16
|
878 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
879 }
|
Chris@16
|
880 catch (Catch1& e)
|
Chris@16
|
881 {
|
Chris@16
|
882 return
|
Chris@16
|
883 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
884 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
885
|
Chris@16
|
886 }
|
Chris@16
|
887 catch (Catch2& e)
|
Chris@16
|
888 {
|
Chris@16
|
889 return
|
Chris@16
|
890 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
891 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
892
|
Chris@16
|
893 }
|
Chris@16
|
894 catch (Catch3& e)
|
Chris@16
|
895 {
|
Chris@16
|
896 return
|
Chris@16
|
897 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
898 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
899 }
|
Chris@16
|
900 }
|
Chris@16
|
901 };
|
Chris@16
|
902
|
Chris@16
|
903 template<class Args, class Catch1, class Catch2>
|
Chris@16
|
904 class lambda_functor_base<action<4, try_catch_action<catch_action<detail::catch_block<Catch1>, detail::catch_block<Catch2>,detail::catch_all_block> > >, Args> {
|
Chris@16
|
905 public:
|
Chris@16
|
906 Args args;
|
Chris@16
|
907 public:
|
Chris@16
|
908 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
909
|
Chris@16
|
910 template <class SigArgs> struct sig {
|
Chris@16
|
911 typedef typename
|
Chris@16
|
912 as_lambda_functor<
|
Chris@16
|
913 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
914 >::type lf_type;
|
Chris@16
|
915
|
Chris@16
|
916 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
917 };
|
Chris@16
|
918
|
Chris@16
|
919 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
920 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
921 try
|
Chris@16
|
922 {
|
Chris@16
|
923 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
924 }
|
Chris@16
|
925 catch (Catch1& e)
|
Chris@16
|
926 {
|
Chris@16
|
927 return
|
Chris@16
|
928 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
929 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
930 }
|
Chris@16
|
931 catch (Catch2& e)
|
Chris@16
|
932 {
|
Chris@16
|
933 return
|
Chris@16
|
934 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
935 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
936 }
|
Chris@16
|
937 catch (...)
|
Chris@16
|
938 {
|
Chris@16
|
939 return
|
Chris@16
|
940 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
941 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
942 }
|
Chris@16
|
943 }
|
Chris@16
|
944 };
|
Chris@16
|
945
|
Chris@16
|
946 // 4 catch types case
|
Chris@16
|
947 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4>
|
Chris@16
|
948 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> {
|
Chris@16
|
949 public:
|
Chris@16
|
950 Args args;
|
Chris@16
|
951 public:
|
Chris@16
|
952 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
953
|
Chris@16
|
954 template <class SigArgs> struct sig {
|
Chris@16
|
955 typedef typename
|
Chris@16
|
956 as_lambda_functor<
|
Chris@16
|
957 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
958 >::type lf_type;
|
Chris@16
|
959
|
Chris@16
|
960 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
961 };
|
Chris@16
|
962
|
Chris@16
|
963 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
964 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
965 try
|
Chris@16
|
966 {
|
Chris@16
|
967 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
968 }
|
Chris@16
|
969 catch (Catch1& e)
|
Chris@16
|
970 {
|
Chris@16
|
971 return
|
Chris@16
|
972 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
973 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
974 }
|
Chris@16
|
975 catch (Catch2& e)
|
Chris@16
|
976 {
|
Chris@16
|
977 return
|
Chris@16
|
978 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
979 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
980 }
|
Chris@16
|
981 catch (Catch3& e)
|
Chris@16
|
982 {
|
Chris@16
|
983 return
|
Chris@16
|
984 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
985 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
986 }
|
Chris@16
|
987 catch (Catch4& e)
|
Chris@16
|
988 {
|
Chris@16
|
989 return
|
Chris@16
|
990 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
991 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
992 }
|
Chris@16
|
993 }
|
Chris@16
|
994 };
|
Chris@16
|
995
|
Chris@16
|
996 template<class Args, class Catch1, class Catch2, class Catch3>
|
Chris@16
|
997 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> {
|
Chris@16
|
998 public:
|
Chris@16
|
999 Args args;
|
Chris@16
|
1000 public:
|
Chris@16
|
1001 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1002
|
Chris@16
|
1003 template <class SigArgs> struct sig {
|
Chris@16
|
1004 typedef typename
|
Chris@16
|
1005 as_lambda_functor<
|
Chris@16
|
1006 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1007 >::type lf_type;
|
Chris@16
|
1008
|
Chris@16
|
1009 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1010 };
|
Chris@16
|
1011
|
Chris@16
|
1012 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1013 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1014 try
|
Chris@16
|
1015 {
|
Chris@16
|
1016 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1017 }
|
Chris@16
|
1018 catch (Catch1& e)
|
Chris@16
|
1019 {
|
Chris@16
|
1020 return
|
Chris@16
|
1021 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1022 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1023 }
|
Chris@16
|
1024 catch (Catch2& e)
|
Chris@16
|
1025 {
|
Chris@16
|
1026 return
|
Chris@16
|
1027 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1028 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1029 }
|
Chris@16
|
1030 catch (Catch3& e)
|
Chris@16
|
1031 {
|
Chris@16
|
1032 return
|
Chris@16
|
1033 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1034 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1035 }
|
Chris@16
|
1036 catch (...)
|
Chris@16
|
1037 {
|
Chris@16
|
1038 return
|
Chris@16
|
1039 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1040 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1041 }
|
Chris@16
|
1042 }
|
Chris@16
|
1043 };
|
Chris@16
|
1044
|
Chris@16
|
1045 // 5 catch types case
|
Chris@16
|
1046 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5>
|
Chris@16
|
1047 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> {
|
Chris@16
|
1048 public:
|
Chris@16
|
1049 Args args;
|
Chris@16
|
1050 public:
|
Chris@16
|
1051 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1052
|
Chris@16
|
1053 template <class SigArgs> struct sig {
|
Chris@16
|
1054 typedef typename
|
Chris@16
|
1055 as_lambda_functor<
|
Chris@16
|
1056 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1057 >::type lf_type;
|
Chris@16
|
1058
|
Chris@16
|
1059 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1060 };
|
Chris@16
|
1061
|
Chris@16
|
1062 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1063 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1064 try
|
Chris@16
|
1065 {
|
Chris@16
|
1066 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1067 }
|
Chris@16
|
1068 catch (Catch1& e)
|
Chris@16
|
1069 {
|
Chris@16
|
1070 return
|
Chris@16
|
1071 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1072 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1073 }
|
Chris@16
|
1074 catch (Catch2& e)
|
Chris@16
|
1075 {
|
Chris@16
|
1076 return
|
Chris@16
|
1077 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1078 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1079 }
|
Chris@16
|
1080 catch (Catch3& e)
|
Chris@16
|
1081 {
|
Chris@16
|
1082 return
|
Chris@16
|
1083 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1084 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1085 }
|
Chris@16
|
1086 catch (Catch4& e)
|
Chris@16
|
1087 {
|
Chris@16
|
1088 return
|
Chris@16
|
1089 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1090 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1091 }
|
Chris@16
|
1092 catch (Catch5& e)
|
Chris@16
|
1093 {
|
Chris@16
|
1094 return
|
Chris@16
|
1095 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1096 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1097 }
|
Chris@16
|
1098 }
|
Chris@16
|
1099 };
|
Chris@16
|
1100
|
Chris@16
|
1101 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4>
|
Chris@16
|
1102 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> {
|
Chris@16
|
1103 public:
|
Chris@16
|
1104 Args args;
|
Chris@16
|
1105 public:
|
Chris@16
|
1106 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1107
|
Chris@16
|
1108 template <class SigArgs> struct sig {
|
Chris@16
|
1109 typedef typename
|
Chris@16
|
1110 as_lambda_functor<
|
Chris@16
|
1111 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1112 >::type lf_type;
|
Chris@16
|
1113
|
Chris@16
|
1114 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1115 };
|
Chris@16
|
1116
|
Chris@16
|
1117 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1118 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1119 try
|
Chris@16
|
1120 {
|
Chris@16
|
1121 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1122 }
|
Chris@16
|
1123 catch (Catch1& e)
|
Chris@16
|
1124 {
|
Chris@16
|
1125 return
|
Chris@16
|
1126 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1127 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1128 }
|
Chris@16
|
1129 catch (Catch2& e)
|
Chris@16
|
1130 {
|
Chris@16
|
1131 return
|
Chris@16
|
1132 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1133 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1134 }
|
Chris@16
|
1135 catch (Catch3& e)
|
Chris@16
|
1136 {
|
Chris@16
|
1137 return
|
Chris@16
|
1138 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1139 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1140 }
|
Chris@16
|
1141 catch (Catch4& e)
|
Chris@16
|
1142 {
|
Chris@16
|
1143 return
|
Chris@16
|
1144 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1145 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1146 }
|
Chris@16
|
1147 catch (...)
|
Chris@16
|
1148 {
|
Chris@16
|
1149 return
|
Chris@16
|
1150 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
|
Chris@16
|
1151 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1152 }
|
Chris@16
|
1153 }
|
Chris@16
|
1154 };
|
Chris@16
|
1155
|
Chris@16
|
1156 // 6 catch types case
|
Chris@16
|
1157 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6>
|
Chris@16
|
1158 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> {
|
Chris@16
|
1159 public:
|
Chris@16
|
1160 Args args;
|
Chris@16
|
1161 public:
|
Chris@16
|
1162 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1163
|
Chris@16
|
1164 template <class SigArgs> struct sig {
|
Chris@16
|
1165 typedef typename
|
Chris@16
|
1166 as_lambda_functor<
|
Chris@16
|
1167 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1168 >::type lf_type;
|
Chris@16
|
1169
|
Chris@16
|
1170 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1171 };
|
Chris@16
|
1172
|
Chris@16
|
1173 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1174 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1175 try
|
Chris@16
|
1176 {
|
Chris@16
|
1177 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1178 }
|
Chris@16
|
1179 catch (Catch1& e)
|
Chris@16
|
1180 {
|
Chris@16
|
1181 return
|
Chris@16
|
1182 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1183 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1184 }
|
Chris@16
|
1185 catch (Catch2& e)
|
Chris@16
|
1186 {
|
Chris@16
|
1187 return
|
Chris@16
|
1188 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1189 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1190 }
|
Chris@16
|
1191 catch (Catch3& e)
|
Chris@16
|
1192 {
|
Chris@16
|
1193 return
|
Chris@16
|
1194 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1195 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1196 }
|
Chris@16
|
1197 catch (Catch4& e)
|
Chris@16
|
1198 {
|
Chris@16
|
1199 return
|
Chris@16
|
1200 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1201 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1202 }
|
Chris@16
|
1203 catch (Catch5& e)
|
Chris@16
|
1204 {
|
Chris@16
|
1205 return
|
Chris@16
|
1206 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
|
Chris@16
|
1207 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1208 }
|
Chris@16
|
1209 catch (Catch6& e)
|
Chris@16
|
1210 {
|
Chris@16
|
1211 return
|
Chris@16
|
1212 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
|
Chris@16
|
1213 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1214 }
|
Chris@16
|
1215 }
|
Chris@16
|
1216 };
|
Chris@16
|
1217
|
Chris@16
|
1218 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5>
|
Chris@16
|
1219 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> {
|
Chris@16
|
1220 public:
|
Chris@16
|
1221 Args args;
|
Chris@16
|
1222 public:
|
Chris@16
|
1223 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1224
|
Chris@16
|
1225 template <class SigArgs> struct sig {
|
Chris@16
|
1226 typedef typename
|
Chris@16
|
1227 as_lambda_functor<
|
Chris@16
|
1228 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1229 >::type lf_type;
|
Chris@16
|
1230
|
Chris@16
|
1231 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1232 };
|
Chris@16
|
1233
|
Chris@16
|
1234 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1235 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1236 try
|
Chris@16
|
1237 {
|
Chris@16
|
1238 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1239 }
|
Chris@16
|
1240 catch (Catch1& e)
|
Chris@16
|
1241 {
|
Chris@16
|
1242 return
|
Chris@16
|
1243 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1244 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1245 }
|
Chris@16
|
1246 catch (Catch2& e)
|
Chris@16
|
1247 {
|
Chris@16
|
1248 return
|
Chris@16
|
1249 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1250 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1251 }
|
Chris@16
|
1252 catch (Catch3& e)
|
Chris@16
|
1253 {
|
Chris@16
|
1254 return
|
Chris@16
|
1255 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1256 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1257 }
|
Chris@16
|
1258 catch (Catch4& e)
|
Chris@16
|
1259 {
|
Chris@16
|
1260 return
|
Chris@16
|
1261 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1262 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1263 }
|
Chris@16
|
1264 catch (Catch5& e)
|
Chris@16
|
1265 {
|
Chris@16
|
1266 return
|
Chris@16
|
1267 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
|
Chris@16
|
1268 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1269 }
|
Chris@16
|
1270 catch (...)
|
Chris@16
|
1271 {
|
Chris@16
|
1272 return
|
Chris@16
|
1273 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
|
Chris@16
|
1274 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1275 }
|
Chris@16
|
1276 }
|
Chris@16
|
1277 };
|
Chris@16
|
1278
|
Chris@16
|
1279 // 7 catch types case
|
Chris@16
|
1280 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
|
Chris@16
|
1281 class Catch7>
|
Chris@16
|
1282 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> {
|
Chris@16
|
1283 public:
|
Chris@16
|
1284 Args args;
|
Chris@16
|
1285 public:
|
Chris@16
|
1286 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1287
|
Chris@16
|
1288 template <class SigArgs> struct sig {
|
Chris@16
|
1289 typedef typename
|
Chris@16
|
1290 as_lambda_functor<
|
Chris@16
|
1291 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1292 >::type lf_type;
|
Chris@16
|
1293
|
Chris@16
|
1294 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1295 };
|
Chris@16
|
1296
|
Chris@16
|
1297 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1298 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1299 try
|
Chris@16
|
1300 {
|
Chris@16
|
1301 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1302 }
|
Chris@16
|
1303 catch (Catch1& e)
|
Chris@16
|
1304 {
|
Chris@16
|
1305 return
|
Chris@16
|
1306 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1307 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1308 }
|
Chris@16
|
1309 catch (Catch2& e)
|
Chris@16
|
1310 {
|
Chris@16
|
1311 return
|
Chris@16
|
1312 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1313 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1314 }
|
Chris@16
|
1315 catch (Catch3& e)
|
Chris@16
|
1316 {
|
Chris@16
|
1317 return
|
Chris@16
|
1318 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1319 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1320 }
|
Chris@16
|
1321 catch (Catch4& e)
|
Chris@16
|
1322 {
|
Chris@16
|
1323 return
|
Chris@16
|
1324 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1325 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1326 }
|
Chris@16
|
1327 catch (Catch5& e)
|
Chris@16
|
1328 {
|
Chris@16
|
1329 return
|
Chris@16
|
1330 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
|
Chris@16
|
1331 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1332 }
|
Chris@16
|
1333 catch (Catch6& e)
|
Chris@16
|
1334 {
|
Chris@16
|
1335 return
|
Chris@16
|
1336 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
|
Chris@16
|
1337 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1338 }
|
Chris@16
|
1339 catch (Catch7& e)
|
Chris@16
|
1340 {
|
Chris@16
|
1341 return
|
Chris@16
|
1342 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
|
Chris@16
|
1343 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1344 }
|
Chris@16
|
1345 }
|
Chris@16
|
1346 };
|
Chris@16
|
1347
|
Chris@16
|
1348 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6>
|
Chris@16
|
1349 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>,
|
Chris@16
|
1350 detail::catch_all_block> > >, Args> {
|
Chris@16
|
1351 public:
|
Chris@16
|
1352 Args args;
|
Chris@16
|
1353 public:
|
Chris@16
|
1354 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1355
|
Chris@16
|
1356 template <class SigArgs> struct sig {
|
Chris@16
|
1357 typedef typename
|
Chris@16
|
1358 as_lambda_functor<
|
Chris@16
|
1359 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1360 >::type lf_type;
|
Chris@16
|
1361
|
Chris@16
|
1362 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1363 };
|
Chris@16
|
1364
|
Chris@16
|
1365 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1366 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1367 try
|
Chris@16
|
1368 {
|
Chris@16
|
1369 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1370 }
|
Chris@16
|
1371 catch (Catch1& e)
|
Chris@16
|
1372 {
|
Chris@16
|
1373 return
|
Chris@16
|
1374 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1375 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1376 }
|
Chris@16
|
1377 catch (Catch2& e)
|
Chris@16
|
1378 {
|
Chris@16
|
1379 return
|
Chris@16
|
1380 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1381 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1382 }
|
Chris@16
|
1383 catch (Catch3& e)
|
Chris@16
|
1384 {
|
Chris@16
|
1385 return
|
Chris@16
|
1386 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1387 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1388 }
|
Chris@16
|
1389 catch (Catch4& e)
|
Chris@16
|
1390 {
|
Chris@16
|
1391 return
|
Chris@16
|
1392 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1393 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1394 }
|
Chris@16
|
1395 catch (Catch5& e)
|
Chris@16
|
1396 {
|
Chris@16
|
1397 return
|
Chris@16
|
1398 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
|
Chris@16
|
1399 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1400 }
|
Chris@16
|
1401 catch (Catch6& e)
|
Chris@16
|
1402 {
|
Chris@16
|
1403 return
|
Chris@16
|
1404 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
|
Chris@16
|
1405 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1406 }
|
Chris@16
|
1407 catch (...)
|
Chris@16
|
1408 {
|
Chris@16
|
1409 return
|
Chris@16
|
1410 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
|
Chris@16
|
1411 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1412 }
|
Chris@16
|
1413 }
|
Chris@16
|
1414 };
|
Chris@16
|
1415
|
Chris@16
|
1416 // 8 catch types case
|
Chris@16
|
1417 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
|
Chris@16
|
1418 class Catch7, class Catch8>
|
Chris@16
|
1419 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>,
|
Chris@16
|
1420 detail::catch_block<Catch7>, detail::catch_block<Catch8> > > >, Args> {
|
Chris@16
|
1421 public:
|
Chris@16
|
1422 Args args;
|
Chris@16
|
1423 public:
|
Chris@16
|
1424 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1425
|
Chris@16
|
1426 template <class SigArgs> struct sig {
|
Chris@16
|
1427 typedef typename
|
Chris@16
|
1428 as_lambda_functor<
|
Chris@16
|
1429 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1430 >::type lf_type;
|
Chris@16
|
1431
|
Chris@16
|
1432 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1433 };
|
Chris@16
|
1434
|
Chris@16
|
1435 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1436 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1437 try
|
Chris@16
|
1438 {
|
Chris@16
|
1439 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1440 }
|
Chris@16
|
1441 catch (Catch1& e)
|
Chris@16
|
1442 {
|
Chris@16
|
1443 return
|
Chris@16
|
1444 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1445 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1446 }
|
Chris@16
|
1447 catch (Catch2& e)
|
Chris@16
|
1448 {
|
Chris@16
|
1449 return
|
Chris@16
|
1450 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1451 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1452 }
|
Chris@16
|
1453 catch (Catch3& e)
|
Chris@16
|
1454 {
|
Chris@16
|
1455 return
|
Chris@16
|
1456 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1457 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1458 }
|
Chris@16
|
1459 catch (Catch4& e)
|
Chris@16
|
1460 {
|
Chris@16
|
1461 return
|
Chris@16
|
1462 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1463 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1464 }
|
Chris@16
|
1465 catch (Catch5& e)
|
Chris@16
|
1466 {
|
Chris@16
|
1467 return
|
Chris@16
|
1468 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
|
Chris@16
|
1469 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1470 }
|
Chris@16
|
1471 catch (Catch6& e)
|
Chris@16
|
1472 {
|
Chris@16
|
1473 return
|
Chris@16
|
1474 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
|
Chris@16
|
1475 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1476 }
|
Chris@16
|
1477 catch (Catch7& e)
|
Chris@16
|
1478 {
|
Chris@16
|
1479 return
|
Chris@16
|
1480 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
|
Chris@16
|
1481 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1482 }
|
Chris@16
|
1483 catch (Catch8& e)
|
Chris@16
|
1484 {
|
Chris@16
|
1485 return
|
Chris@16
|
1486 detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
|
Chris@16
|
1487 ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1488 }
|
Chris@16
|
1489 }
|
Chris@16
|
1490 };
|
Chris@16
|
1491
|
Chris@16
|
1492 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
|
Chris@16
|
1493 class Catch7>
|
Chris@16
|
1494 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>,
|
Chris@16
|
1495 detail::catch_block<Catch7>,detail::catch_all_block> > >, Args> {
|
Chris@16
|
1496 public:
|
Chris@16
|
1497 Args args;
|
Chris@16
|
1498 public:
|
Chris@16
|
1499 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1500
|
Chris@16
|
1501 template <class SigArgs> struct sig {
|
Chris@16
|
1502 typedef typename
|
Chris@16
|
1503 as_lambda_functor<
|
Chris@16
|
1504 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1505 >::type lf_type;
|
Chris@16
|
1506
|
Chris@16
|
1507 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1508 };
|
Chris@16
|
1509
|
Chris@16
|
1510 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1511 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1512 try
|
Chris@16
|
1513 {
|
Chris@16
|
1514 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1515 }
|
Chris@16
|
1516 catch (Catch1& e)
|
Chris@16
|
1517 {
|
Chris@16
|
1518 return
|
Chris@16
|
1519 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1520 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1521 }
|
Chris@16
|
1522 catch (Catch2& e)
|
Chris@16
|
1523 {
|
Chris@16
|
1524 return
|
Chris@16
|
1525 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1526 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1527 }
|
Chris@16
|
1528 catch (Catch3& e)
|
Chris@16
|
1529 {
|
Chris@16
|
1530 return
|
Chris@16
|
1531 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1532 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1533 }
|
Chris@16
|
1534 catch (Catch4& e)
|
Chris@16
|
1535 {
|
Chris@16
|
1536 return
|
Chris@16
|
1537 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1538 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1539 }
|
Chris@16
|
1540 catch (Catch5& e)
|
Chris@16
|
1541 {
|
Chris@16
|
1542 return
|
Chris@16
|
1543 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
|
Chris@16
|
1544 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1545 }
|
Chris@16
|
1546 catch (Catch6& e)
|
Chris@16
|
1547 {
|
Chris@16
|
1548 return
|
Chris@16
|
1549 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
|
Chris@16
|
1550 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1551 }
|
Chris@16
|
1552 catch (Catch7& e)
|
Chris@16
|
1553 {
|
Chris@16
|
1554 return
|
Chris@16
|
1555 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
|
Chris@16
|
1556 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1557 }
|
Chris@16
|
1558 catch (...)
|
Chris@16
|
1559 {
|
Chris@16
|
1560 return
|
Chris@16
|
1561 detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
|
Chris@16
|
1562 ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1563 }
|
Chris@16
|
1564 }
|
Chris@16
|
1565 };
|
Chris@16
|
1566
|
Chris@16
|
1567 // 9 catch types case
|
Chris@16
|
1568 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
|
Chris@16
|
1569 class Catch7, class Catch8, class Catch9>
|
Chris@16
|
1570 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>,
|
Chris@16
|
1571 detail::catch_block<Catch7>, detail::catch_block<Catch8>, detail::catch_block<Catch9> > > >, Args> {
|
Chris@16
|
1572 public:
|
Chris@16
|
1573 Args args;
|
Chris@16
|
1574 public:
|
Chris@16
|
1575 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1576
|
Chris@16
|
1577 template <class SigArgs> struct sig {
|
Chris@16
|
1578 typedef typename
|
Chris@16
|
1579 as_lambda_functor<
|
Chris@16
|
1580 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1581 >::type lf_type;
|
Chris@16
|
1582
|
Chris@16
|
1583 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1584 };
|
Chris@16
|
1585
|
Chris@16
|
1586 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1587 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1588 try
|
Chris@16
|
1589 {
|
Chris@16
|
1590 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1591 }
|
Chris@16
|
1592 catch (Catch1& e)
|
Chris@16
|
1593 {
|
Chris@16
|
1594 return
|
Chris@16
|
1595 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1596 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1597 }
|
Chris@16
|
1598 catch (Catch2& e)
|
Chris@16
|
1599 {
|
Chris@16
|
1600 return
|
Chris@16
|
1601 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1602 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1603 }
|
Chris@16
|
1604 catch (Catch3& e)
|
Chris@16
|
1605 {
|
Chris@16
|
1606 return
|
Chris@16
|
1607 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1608 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1609 }
|
Chris@16
|
1610 catch (Catch4& e)
|
Chris@16
|
1611 {
|
Chris@16
|
1612 return
|
Chris@16
|
1613 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1614 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1615 }
|
Chris@16
|
1616 catch (Catch5& e)
|
Chris@16
|
1617 {
|
Chris@16
|
1618 return
|
Chris@16
|
1619 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
|
Chris@16
|
1620 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1621 }
|
Chris@16
|
1622 catch (Catch6& e)
|
Chris@16
|
1623 {
|
Chris@16
|
1624 return
|
Chris@16
|
1625 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
|
Chris@16
|
1626 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1627 }
|
Chris@16
|
1628 catch (Catch7& e)
|
Chris@16
|
1629 {
|
Chris@16
|
1630 return
|
Chris@16
|
1631 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
|
Chris@16
|
1632 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1633 }
|
Chris@16
|
1634 catch (Catch8& e)
|
Chris@16
|
1635 {
|
Chris@16
|
1636 return
|
Chris@16
|
1637 detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
|
Chris@16
|
1638 ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1639 }
|
Chris@16
|
1640 catch (Catch9& e)
|
Chris@16
|
1641 {
|
Chris@16
|
1642 return
|
Chris@16
|
1643 detail::return_or_throw<RET, typename ::boost::tuples::element<9, Args>::type>
|
Chris@16
|
1644 ::call(::boost::tuples::get<9>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1645 }
|
Chris@16
|
1646 }
|
Chris@16
|
1647 };
|
Chris@16
|
1648
|
Chris@16
|
1649 template<class Args, class Catch1, class Catch2, class Catch3, class Catch4, class Catch5, class Catch6,
|
Chris@16
|
1650 class Catch7, class Catch8>
|
Chris@16
|
1651 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>,
|
Chris@16
|
1652 detail::catch_block<Catch7>, detail::catch_block<Catch8>,detail::catch_all_block> > >, Args> {
|
Chris@16
|
1653 public:
|
Chris@16
|
1654 Args args;
|
Chris@16
|
1655 public:
|
Chris@16
|
1656 explicit lambda_functor_base(const Args& a) : args(a) {}
|
Chris@16
|
1657
|
Chris@16
|
1658 template <class SigArgs> struct sig {
|
Chris@16
|
1659 typedef typename
|
Chris@16
|
1660 as_lambda_functor<
|
Chris@16
|
1661 typename boost::tuples::element<0, Args>::type
|
Chris@16
|
1662 >::type lf_type;
|
Chris@16
|
1663
|
Chris@16
|
1664 typedef typename lf_type::inherited::template sig<SigArgs>::type type;
|
Chris@16
|
1665 };
|
Chris@16
|
1666
|
Chris@16
|
1667 template<class RET, CALL_TEMPLATE_ARGS>
|
Chris@16
|
1668 RET call(CALL_FORMAL_ARGS) const {
|
Chris@16
|
1669 try
|
Chris@16
|
1670 {
|
Chris@16
|
1671 return detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1672 }
|
Chris@16
|
1673 catch (Catch1& e)
|
Chris@16
|
1674 {
|
Chris@16
|
1675 return
|
Chris@16
|
1676 detail::return_or_throw<RET, typename ::boost::tuples::element<1, Args>::type>
|
Chris@16
|
1677 ::call(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1678 }
|
Chris@16
|
1679 catch (Catch2& e)
|
Chris@16
|
1680 {
|
Chris@16
|
1681 return
|
Chris@16
|
1682 detail::return_or_throw<RET, typename ::boost::tuples::element<2, Args>::type>
|
Chris@16
|
1683 ::call(::boost::tuples::get<2>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1684 }
|
Chris@16
|
1685 catch (Catch3& e)
|
Chris@16
|
1686 {
|
Chris@16
|
1687 return
|
Chris@16
|
1688 detail::return_or_throw<RET, typename ::boost::tuples::element<3, Args>::type>
|
Chris@16
|
1689 ::call(::boost::tuples::get<3>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1690 }
|
Chris@16
|
1691 catch (Catch4& e)
|
Chris@16
|
1692 {
|
Chris@16
|
1693 return
|
Chris@16
|
1694 detail::return_or_throw<RET, typename ::boost::tuples::element<4, Args>::type>
|
Chris@16
|
1695 ::call(::boost::tuples::get<4>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1696 }
|
Chris@16
|
1697 catch (Catch5& e)
|
Chris@16
|
1698 {
|
Chris@16
|
1699 return
|
Chris@16
|
1700 detail::return_or_throw<RET, typename ::boost::tuples::element<5, Args>::type>
|
Chris@16
|
1701 ::call(::boost::tuples::get<5>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1702 }
|
Chris@16
|
1703 catch (Catch6& e)
|
Chris@16
|
1704 {
|
Chris@16
|
1705 return
|
Chris@16
|
1706 detail::return_or_throw<RET, typename ::boost::tuples::element<6, Args>::type>
|
Chris@16
|
1707 ::call(::boost::tuples::get<6>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1708 }
|
Chris@16
|
1709 catch (Catch7& e)
|
Chris@16
|
1710 {
|
Chris@16
|
1711 return
|
Chris@16
|
1712 detail::return_or_throw<RET, typename ::boost::tuples::element<7, Args>::type>
|
Chris@16
|
1713 ::call(::boost::tuples::get<7>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1714 }
|
Chris@16
|
1715 catch (Catch8& e)
|
Chris@16
|
1716 {
|
Chris@16
|
1717 return
|
Chris@16
|
1718 detail::return_or_throw<RET, typename ::boost::tuples::element<8, Args>::type>
|
Chris@16
|
1719 ::call(::boost::tuples::get<8>(args), CALL_ACTUAL_ARGS_NO_ENV, e);
|
Chris@16
|
1720 }
|
Chris@16
|
1721 catch (...)
|
Chris@16
|
1722 {
|
Chris@16
|
1723 return
|
Chris@16
|
1724 detail::return_or_throw<RET, typename ::boost::tuples::element<9, Args>::type>
|
Chris@16
|
1725 ::call(::boost::tuples::get<9>(args), CALL_ACTUAL_ARGS);
|
Chris@16
|
1726 }
|
Chris@16
|
1727 }
|
Chris@16
|
1728 };
|
Chris@16
|
1729
|
Chris@16
|
1730
|
Chris@16
|
1731 } // namespace lambda
|
Chris@16
|
1732 } // namespace boost
|
Chris@16
|
1733
|
Chris@16
|
1734
|
Chris@16
|
1735 #endif
|
Chris@16
|
1736
|
Chris@16
|
1737
|
Chris@16
|
1738
|
Chris@16
|
1739
|
Chris@16
|
1740
|
Chris@16
|
1741
|