BOOST_YAP_USER_BINARY_OPERATOR
// In header: <boost/yap/user_macros.hpp>
BOOST_YAP_USER_BINARY_OPERATOR(op_name, expr_template, result_expr_template)
Defines operator overloads for binary operator op_name that each produce an expression instantiated from the expr_template expression template. One overload is defined for each of the qualifiers const &
, &
, and &&
. For the lvalue reference overloads, *this
is captured by reference into the resulting expression. For the rvalue reference overload, *this
is moved into the resulting expression.
Note that this does not work for yap::expr_kinds assign, subscript, or call. Use BOOST_YAP_USER_ASSIGN_OPERATOR, BOOST_YAP_USER_SUBSCRIPT_OPERATOR, or BOOST_YAP_USER_CALL_OPERATOR for those, respectively.
Example:
template <boost::yap::expr_kind Kind, typename Tuple> struct user_expr { static const boost::yap::expr_kind kind = Kind; Tuple elements; }; // Operator overloads for operator&&() BOOST_YAP_USER_BINARY_OPERATOR(logical_and, user_expr, user_expr)
Parameters: |
|