|
GMP 0.3.0
Generative Metaprogramming library for C++
|
Facilities for building custom infix syntax from callable objects. More...
Functions | |
| template<typename Func > | |
| constexpr auto | gmp::make_named_operator (Func &&f) |
| Create a token that lets a callable be used as a named infix operator. | |
The returned token can be placed between two matching operator symbols to call the stored callable with the left and right operands. Default generated forms include lhs ^op^ rhs, lhs <op> rhs, and matching pairs for +, *, -, /, %, &, and |.
The callable is stored by value. The left operand is stored as a reference when it is an lvalue and by value when it is an rvalue. The right operand is forwarded directly at the final invocation.
| Func | The callable type. |
| f | The callable object used by the named operator. |
Definition at line 186 of file named_operator.hpp.
References gmp::enum_values().