Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template basic_expr

boost::proto::basic_expr — Simplified representation of a node in an expression tree.

Synopsis

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

template<typename Tag, typename Args,  Arity = > 
struct basic_expr {
  // types
  typedef                          ;         
  typedef                         ;        
  typedef          ;       
  typedef proto::basic_default_domain ;      
  typedef                   ;     
  typedef                   ;   
  typedef                   ;
  typedef        ;        // For each N in [0,max(Arity,1)).

  // public static functions
  template<typename... A>  (...);

  // public member functions
   ();
   () ;
};

Description

proto::basic_expr<> is a node in an expression template tree. It is a container for its child sub-trees. It also serves as the terminal nodes of the tree.

Tag is type that represents the operation encoded by this expression. It is typically one of the structs in the boost::proto::tag namespace, but it doesn't have to be. If Arity is 0 then this expr<> type represents a leaf in the expression tree.

Args is a list of types representing the children of this expression. It is an instantiation of one of proto::list1<>, proto::list2<>, etc. The child types must all themselves be either proto::expr<> or proto::basic_expr<>& (or extensions thereof via proto::extends<> or BOOST_PROTO_EXTENDS()), unless Arity is 0, in which case Args must be proto::term<T>, where T can be any type.

proto::basic_expr<> is a valid Fusion random-access sequence, where the elements of the sequence are the child expressions.

basic_expr public static functions

  1. template<typename... A>  (... a);

    Requires:

    The number of supplied arguments must be max(Arity,1).

    Returns:

    A new basic_expr object initialized with the specified arguments.

basic_expr public member functions

  1.  ();

    Returns:

    *this

  2.  () ;

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


PrevUpHomeNext