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 vararg

boost::proto::vararg — For matching a Grammar to a variable number of sub-expressions.


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

template<typename Grammar> 
struct vararg {


An expression type proto::basic_expr<AT, proto::listN<A0,...An,U0,...Um> > matches a grammar proto::basic_expr<BT, proto::listM<B0,...Bn,proto::vararg<V> > > if BT is proto::_ or AT, and if Ax matches Bx for each x in [0,n] and if Ux matches V for each x in [0,m].

For example:

// Match any function call expression, regardless
// of the number of function arguments:
struct Function :
  proto::function< proto::vararg<proto::_> >

When used as a transform, proto::vararg<G> applies G's transform.