...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
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.
// In header: <boost/proto/matches.hpp> template<typename Cases> struct switch_ : proto::transform<switch_<Cases> > { // types typedef switch_ proto_base_expr; // member classes/structs/unions template<typename Expr, typename State, typename Data> struct impl : Cases::template case_<typename Expr::tag_type>::template impl<Expr, State, Data> { }; };