![]() |
Home | Libraries | People | FAQ | More |
boost::proto::context::default_eval — A BinaryFunction that accepts a Proto expression and a context, evaluates each child expression with the context, and combines the result using the standard C++ meaning for the operator represented by the current expression node.
// In header: <boost/proto/context/default.hpp> template<typename Expr, typename Context> struct default_eval { // types typedef ; // For exposition only typedef ; // public member functions (, ) ; // public data members static s_expr; // For exposition only static s_context; // For exposition only };
Let
be the C++ operator
corresponding to OP
Expr::proto_tag
. (For example, if
Tag
is
proto::tag::plus
, let
be OP
+
.)
The behavior of this class is specified in terms of the C++0x decltype
keyword. In systems where this keyword is not available, Proto uses the Boost.Typeof library to
approximate the behavior.
default_eval
public
types
If Tag
corresponds to a unary prefix operator,
then the result type is
proto::eval(proto::child(
If Tag
corresponds to a unary postfix operator,
then the result type is
proto::eval(proto::child(
If Tag
corresponds to a binary infix operator,
then the result type is
proto::eval(proto::left(proto::eval(proto::right(
If Tag
is
proto::tag::subscript
,
then the result type is
proto::eval(proto::left(proto::eval(proto::right(
If Tag
is
proto::tag::if_else_
,
then the result type is
proto::eval(proto::child_c<proto::eval(proto::child_c<proto::eval(proto::child_c<
If Tag
is
proto::tag::function
,
then the result type is
proto::eval(proto::child_c<proto::eval(proto::child_c<proto::eval(proto::child_c<
default_eval
public member functions( expr, context) ;
If Tag
corresponds to a unary prefix operator,
then return
OPproto::eval
(proto::child
(expr), context)
If Tag
corresponds to a unary postfix operator,
then return
proto::eval
(proto::child
(expr), context) OP
If Tag
corresponds to a binary infix operator,
then return
proto::eval
(proto::left
(expr), context) OPproto::eval
(proto::right
(expr), context)
If Tag
is
,
then return
proto::tag::subscript
proto::eval
(proto::left
(expr), context) [proto::eval
(proto::right
(expr), context) ]
If Tag
is
,
then return
proto::tag::if_else_
proto::eval
(proto::child_c
<0>(expr), context) ?proto::eval
(proto::child_c
<1>(expr), context) :proto::eval
(proto::child_c
<2>(expr), context)
If Tag
is
,
then return
proto::tag::function
proto::eval
(proto::child_c
<0>(expr), context) (proto::eval
(proto::child_c
<1>(expr), context), ...proto::eval
(proto::child_c
<N>(expr), context) )
Parameters: |
|