Chapter 7
Chapter 7
Operator Overloading
and
Type Conversions
We can overload all the C++ operators except the following:
• Class member access operators (., .*).
• Scope resolution operator (::).
• Size operator (sizeof).
• Conditional operator (?:).
The reason why we cannot overload these operators may be
attributed to the fact that these operators take names
(example class name) as their operand instead of values, as
is the case with other normal operators.