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


// 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;


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.