Struct template switch_
boost::proto::switch_ — For matching one of a set of alternate grammars, which are looked up based on an
expression's tag type. When used as a transform,
proto::switch_<>
applies the transform associated
with the sub-grammar that matches the expression.
Synopsis
template<typename Cases>
struct switch_ : proto::transform<switch_<Cases> > {
// types
typedef switch_ proto_base_expr;
template<typename Expr, typename State, typename Data>
struct impl :
Cases::template case_<typename Expr::tag_type>::template impl<Expr, State, Data>
{
};
};
Description
An expression type E
matches
proto::switch_<C>
if
E
matches
C::case_<E::proto_tag>
.
When applying proto::switch_<C>
as a transform
with an expression e
of type
E
, state s
and
data v
, it is equivalent to
C::case_<E::proto_tag>()(e, s, v)
.