BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR
// In header: <boost/yap/user_macros.hpp>
BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(op_name, expr_template, udt_trait)
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:
template <boost::yap::expr_kind Kind, typename Tuple> struct user_expr { static const boost::yap::expr_kind kind = Kind; Tuple elements; }; template <typename T> struct is_vector : std::false_type {}; template <typename T, typename A> struct is_vector<std::vector<T, A>> : std::true_type {}; // Defines an overload of operator&&() that matches a vector on either side, // and any type (possibly a vector) on the other. BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(logical_and, ::user_expr, is_vector)
Parameters: |
|