![]() |
Home | Libraries | People | FAQ | More |
boost::proto::extends — For adding behaviors to a Proto expression template.
// 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;
};
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 member functions();
Returns: |
proto_expr_.proto_base() |
Throws: |
Will not throw. |
() ;
Returns: |
proto_expr_.proto_base() |
Throws: |
Will not throw. |
template<typename A>
( a);
Lazy assignment expression
Returns: |
A new expression node representing the assignment operation. |
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.
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.
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.
template<typename A>
( a);
Lazy subscript expression
Returns: |
A new expression node representing the subscript operation. |
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.
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.
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.
template<typename... A>
(... a);
Lazy function call
Returns: |
A new expression node representing the function call operation. |
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.