
Operator Overloading 193
4.10 Deep Knowledge Section
Why can the scope resolution operator (::), sizeof operator, member selection operator (.), con-
ditional operator not be overloaded?
Scope resolution (::)
The scope resoultion operator is used to identify a variable defined in
a particular scope. Based on the operands of
::, the scope of the vari-
able is determined. Hence, there is no need to overload because it
deals with names and not with expressions.
sizeof sizeof operator works with objects in the same way it operates with
variables. If the
sizeof operator is overloaded, it will create a confusion
if it returns a size different from the ...