match_c

Synopsis

template <class Pattern, class Expression>
struct match_c
{
  // unspecified
};

Description

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

#include <mpllibs/metamonad/match_c.hpp>

Expression semantics

For any p and e classes

match_c<p, e>::type

is equivalent to

match<syntax<p>, e>::type

Example

using namespace mpllibs::metamonad::name;

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

typedef
  boost::mpl::at<
    match_c<just<var<x>>, maybe_something<int>::type>::type,
    var<x>
  >::type
  this_is_double;

[up]