An operator function
- be a member function or
- be a non-member function that
has at least one non-object parameter whose type is a class, a reference to a class, an
enumeration, or a reference to an enumeration.
It is not possible to change the precedence, grouping, or number of operands
The meaning of
the operators =
, (unary) &
, and ,
predefined for each type, can be changed for specific class types by
defining operator functions that implement these operators.
Likewise, the meaning of the operators (unary) &
can be changed for specific enumeration types.
Operator functions are inherited in the same manner as other base class