match_let_c

Synopsis

template <class Pattern, class Exp, class Body>
struct match_let_c
{
  // unspecified
};

Description

The same as match_let, but Pattern and Body are angle-bracket expressions and not syntaxes.

#include <mpllibs/metamonad/match_let_c.hpp>

Expression semantics

For any p, e and b classes

match_let_c<p, e, b>::type

is equivalent to

match_let<syntax<p>, e, syntax<b>>::type

Example

using namespace mpllibs::metamonad::name;

template <class A>
struct maybe_something :
  boost::mpl::if_<
    typename boost::is_same<A, int>::type,
    just<returns<double>>,
    nothing
  >
{};

typedef
  eval_syntax<
    match_let_c<
      just<var<x>>, maybe_something<int>::type,
      x
    >
  >::type
  this_is_double;

[up]