If you got here without reading the Operators section, go read that first. Here are the operator macros and their uses:
Table 1.1. Unary and Binary Operator-Defining Macros
Macro |
Use |
First/Left Operand Type |
Right Operand Type |
Notes |
---|---|---|---|---|
Unary operators. |
An Expression
instantiated from ExpressionTemplate
macro parameter |
-- |
||
Binary operators. |
Any type. |
Any type. |
At least one parameter must be an Expression
instantiated from ExpressionTemplate
macro parameter |
|
Free operators defined over non-Expression
types constrained by a type trait (e.g. all |
Any non-Expression that satisfies the given type trait. |
-- |
||
Free operators defined over non-Expression
types constrained by a pair of type traits (e.g. a |
Any non-Expression that satisfies the left-hand type trait. |
Any non-Expression that satisfies the right-hand type trait. |
||
Free operators defined over pairs of non-Expression
types, one constrained by a type trait and one not (e.g. a |
Any non-Expression. |
-- |
At least one parameter must satisfy the given type trait. |
Some operators may only be defined as member functions, and so are not covered by general-purpose the unary and binary operator macros above:
Table 1.2. The Member-Only Operator Macros
Macro |
Use |
Operands |
Notes |
---|---|---|---|
Assignment operator. |
Any type except |
Does not conflict with the assignment or move assignment operators. |
|
Subscript operator. |
Any type. |
||
Call operator taking any number of parameters. |
Any type. |
||
Call operator taking exactly N parameters. |
Any type. |
Table 1.3. if_else Psuedo-Operator Macros
Macro |
Use |
Operands |
Notes |
---|---|---|---|
Free |
Any type. |
At least one parameter must be an Expression. |
|
Free |
Any non-Expression. |
At least one parameter must satisfy the given type trait. |
Note | |
---|---|
Operands are handled in a uniform way across all functions defined by all the macros listed here. See How Expression Operands Are Treated for details. |