Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template extends

boost::proto::extends — For adding behaviors to a Proto expression template.

Synopsis

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

template<typename Expr, typename Derived, 
         typename Domain = proto::default_domain> 
struct extends {
  // types
  typedef           ;   
  typedef                                   ;      
  typedef                                  ;
  typedef                                  ;     
  typedef      ;         
  typedef     ;        
  typedef    ;       
  typedef  ;     
  typedef   ;        // For each N in [0,max(1,proto_arity_c))

  // member classes/structs/unions
  template<typename Signature> 
  struct result {
    // types
    typedef  ;
  };

  // construct/copy/destruct
  ();
  (extends );
  ();

  // public static functions
   ();

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

  // public data members
   proto_expr_;  // For exposition only.
  static  proto_arity_c;  // = proto_base_expr::proto_arity_c;
};

Description

Use proto::extends<> to give expressions in your domain custom data members and member functions.

Conceptually, using proto::extends<> is akin to inheriting from proto::expr<> and adding your own members. Using proto::extends<> is generally preferrable to straight inheritance because the members that would be inherited from proto::expr<> would be wrong; they would incorrectly slice off your additional members when building larger expressions from smaller ones. proto::extends<> automatically gives your expression types the appropriate operator overloads that preserve your domain-specific members when composing expression trees.

Expression extensions are typically defined as follows:

See also:

extends public construct/copy/destruct

  1. ();
  2. (extends  that);
  3. ( expr_);

extends public static functions

  1.  ( expr);

    Construct an expression extension from the base expression.

extends public member functions

  1.  ();

    Returns:

    proto_expr_.proto_base()

    Throws:

    Will not throw.
  2.  () ;

    Returns:

    proto_expr_.proto_base()

    Throws:

    Will not throw.
  3. template<typename A>  ( a);

    Lazy assignment expression

    Returns:

    A new expression node representing the assignment operation.

  4. template<typename A>  ( a);

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

  5. template<typename A>  ( a) ;

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

  6. template<typename A>  ( a) ;

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

  7. template<typename A>  ( a);

    Lazy subscript expression

    Returns:

    A new expression node representing the subscript operation.

  8. template<typename A>  ( a);

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

  9. template<typename A>  ( a) ;

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

  10. template<typename A>  ( a) ;

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

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

    Lazy function call

    Returns:

    A new expression node representing the function call operation.

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

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


PrevUpHomeNext