Boost C++ Libraries

...one 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.
PrevUpHomeNext

Struct template vararg

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

Synopsis

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

template<typename Grammar> 
struct vararg {
};

Description

An expression type proto::expr<AT, proto::listN<A0,...An,U0,...Um> > matches a grammar proto::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.


PrevUpHomeNext