try_c

Synopsis

template <class Expr, class... Catches>
struct try_c
{
  // unspecified...
};

Description

The same as try_, but the expression is an angle-bracket expression and not a syntax.

#include <mpllibs/metamonad/try_c.hpp>

Expression semantics

For any e angle-bracket expression, n > 0 and c1, ..., ck catch blocks

try_c<e, c1, ..., cn>::type

is equivalent to

try<syntax<e>, c1, ..., cn>::type

Example

using boost::mpl::int_;
using namespace mpllibs::metamonad::name;

struct error_tag_1;
struct error_tag_2;

struct unknown_error_detected;

try_c<
  may_fail2<may_fail1<int_<13>>>,
  catch_c<e, is_tag<error_tag_1, e>, int_<11>>,
  catch_c<e, is_tag<error_tag_2, e>, e>,
  catch_c<e, true_, unknown_error_detected>
>

[up]