| Home | Libraries | People | FAQ | More

## 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::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.