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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

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.


template<typename Tag, typename... A> 
struct nary_expr :  proto::transform< nary_expr<Tag, A...> > {
  // types
  typedef proto::expr< Tag, proto::listN< A0 > > type;           
  typedef type                                   proto_base_expr;
  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.