eval_match_let

Synopsis

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

Description

This is similar to match_let, but it evaluates the substituted expression.

#include <mpllibs/metamonad/eval_match_let.hpp>

Expression semantics

For any p, x and f classes

eval_match_let<p, x, f>

is equivalent to

eval_syntax<match_let<p, x, f>>

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_match_let<
    syntax<just<var<x>>>, maybe_something<int>::type,
    syntax<x>
  >::type
  this_is_double;

[up]