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 an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Macro BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR

BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR

Synopsis

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

BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(op_name, expr_template, udt_trait)

Description

Defines a free/non-member operator overload for binary operator op_name that produces an expression instantiated from the expr_template expression template.

The lhs and rhs parameters to the defined operator overload may be any types that are not expressions. Each parameter is wrapped in a terminal expression.

At least one of the parameters to the defined operator overload must be a type T for which

udt_trait<std::remove_cv_t<std::remove_reference_t<T>>>::value 

is true.

Example:


Parameters:

expr_template

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

op_name

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

udt_trait

A trait template to use to constrain which types are accepted as template parameters to the defined operator overload.


PrevUpHomeNext