BOOST_YAP_USER_UDT_UNARY_OPERATOR
// In header: <boost/yap/user_macros.hpp>
BOOST_YAP_USER_UDT_UNARY_OPERATOR(op_name, expr_template, udt_trait)
Defines a free/non-member operator overload for unary operator op_name that produces an expression instantiated from the expr_template expression template.
The parameter to the defined operator overload may be any type that is not an expression and for which
udt_trait<std::remove_cv_t<std::remove_reference_t<T>>>::value
is true. The parameter is wrapped in a terminal expression.
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 applies to vectors and returns // expressions instantiated from user_expr. BOOST_YAP_USER_UDT_UNARY_OPERATOR(logical_not, ::user_expr, is_vector)
Parameters: |
|