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 binary_expr

boost::proto::binary_expr — A metafunction for generating binary expression types with a specified tag type, a grammar element for matching binary expressions, and a PrimitiveTransform that dispatches to the proto::pass_through<> transform.


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

template<typename Tag, typename T, typename U> 
struct binary_expr :  proto::transform< binary_expr<Tag, T, U> > {
  // types
  typedef proto::expr< Tag, proto::list2< T, U > > type;           
  typedef type                                     proto_base_expr;
  template<typename Expr, typename State, typename Data> 
  struct impl :
     proto::pass_through<binary_expr>::template impl<Expr, State, Data>


Use proto::binary_expr<proto::_, proto::_, proto::_> as a grammar element to match any binary expression.