![]() |
Home | Libraries | People | FAQ | More |
boost::proto::_ — A wildcard grammar element that matches any expression, and a transform that returns the current expression unchanged.
// In header: <boost/proto/matches.hpp> struct _ : proto::transform<_> { // types typedef ; // member classes/structs/unions template<typename Expr, typename State, typename Data> struct impl : proto::transform_impl<Expr, State, Data> { // types typedef ; // public member functions (, , ) ; }; };
The wildcard type, proto::_
, is a grammar element such
that proto::matches<E, proto::_>::value
is true
for any expression type E
.
The wildcard can also be used as a stand-in for a template argument when matching terminals.
For instance, the following is a grammar that will match any
std::complex<>
terminal:
proto::matches< proto::terminal<proto::terminal< > ));
When used as a transform, proto::_
returns the current expression
unchanged. For instance, in the following, proto::_
is used with
the proto::fold<>
transform to fold the children of a node:
proto::or_< // Terminals have no children proto::when<proto::terminal<proto::otherwise< proto::fold< proto::_state,