Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit b9ab49fc70.
PrevUpHomeNext

Macro BOOST_YAP_USER_BINARY_OPERATOR

BOOST_YAP_USER_BINARY_OPERATOR

Synopsis

// In header: <boost/yap/user_macros.hpp>

BOOST_YAP_USER_BINARY_OPERATOR(op_name, expr_template, result_expr_template)

Description

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:


Parameters:

expr_template

The expression template to which the overloads apply. expr_template must be an ExpressionTemplate.

op_name

The operator to be overloaded; this must be one of the binary enumerators in expr_kind, except assign, subscript, or call, without the expr_kind:: qualification.

result_expr_template

The expression template to use to instantiate the result expression. result_expr_template must be an ExpressionTemplate.


PrevUpHomeNext