| Home | Libraries | People | FAQ | More

## Struct template and_

boost::proto::and_ — For matching all of a set of grammars. When used as a transform, `proto::and_<>` applies the transform associated with the last grammar in the set.

## Synopsis

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

    template<typename... G>
    struct and_ :  proto::transform<and_<G...> > {
      // types
      typedef and_ proto_base_expr;
      template<typename Expr, typename State, typename Data>
      struct impl :  proto::transform_impl< Expr, State, Data > {
        // types
        typedef typename boost::result_of<Gn(Expr, State, Data)>::type result_type;

        // public member functions
        result_type operator()(typename impl::expr_param,
                               typename impl::state_param,
                               typename impl::data_param) const;
      };
    };

## Description

An expression type `E` matches `proto::and_<G0,G1,...Gn>` if `E` matches all `Gx` for `x` in `[0,n]`.

When applying `proto::and_<G0,G1,...Gn>` as a transform with an expression `e`, state `s` and data `v`, it is equivalent to `Gn()(e, s, v)`.

The maximun number of template arguments `proto::and_<>` accepts is controlled by the `BOOST_PROTO_MAX_LOGICAL_ARITY` macro.