Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.

Struct template nary_expr

boost::proto::nary_expr — A metafunction for generating n-ary expression types with a specified tag type, a grammar element for matching n-ary expressions, and a PrimitiveTransform that dispatches to the proto::pass_through<> transform.


// In header: <boost/proto/traits.hpp>

template<typename Tag, typename... A> 
struct nary_expr :  proto::transform< nary_expr<Tag, A...> > {
  // types
  typedef proto::expr< Tag, proto::listN< A... > > type;           
  typedef type                                     proto_base_expr;

  // member classes/structs/unions
  template<typename Expr, typename State, typename Data> 
  struct impl :
     proto::pass_through<nary_expr>::template impl<Expr, State, Data>


Use proto::nary_expr<proto::_, proto::vararg<proto::_> > as a grammar element to match any n-ary expression; that is, any non-terminal.