Operator overloading facilitates the specification of user-defined implementation for operations wherein one or both operands are of user-defined class or structure type . This helps user-defined types to behave much like the fundamental primitive data types.
Read moreWhich operator can be overloaded?
However, when you overload a binary operator, the corresponding compound assignment operator , if any, is also implicitly overloaded. For example, += is evaluated using + , which can be overloaded. These operators cannot be overloaded. The comparison operators must be overloaded in pairs.
Read moreWhat are overloaded operators in C++?
Overloaded operators are functions with special names: the keyword “operator” followed by the symbol for the operator being defined . Like any other function, an overloaded operator has a return type and a parameter list.
Read more