Operators that cannot be overloaded cpp

1  :: (scope resolution)

2  . (member selection)

3   .* (member selection through pointer to function)

These three operators  take a variable name rather than a value as their second operand and provide the primary means of referring to members.So syntactically these operators can not be overridden

4     ?: (Ternary or Conditional Operator )

The same reason why you really should not (although you can) overload && or || operators – doing so would disable short-circuiting on those operators (evaluating only the necessary part and not everything), which can lead to severe complications.

5    sizeof Operator

the sizeof operator returns the size of the object /type passed as an operand. It is evaluated by the compiler not at runtime ,so you can not overload it with your own runtime code. It is syntactically not possible to do.

Even if it was pointer arithmetic relies on the correct value being returned by this operator since the compiler already knows how to calculate the correct value all overloading you would do, would be to allow you to calculate an incorrect value, something that would almost certainly lead to the program not working correctly.

6    typeid (Object type Operator)

For typeid, for instance, the whole point is to uniquely identify a
type. If you’re trying to make a user-defined type “look” like another
type, you’re better off taking advantage of polymorphism and/or
type-conversion  semantics

Resolving technical problems:

Solve your technical problems instantly

We provide Remote Technical Support from Monday to Sunday, 7:00PM to 1:00 AM

Mail your problem details at [email protected] along with your mobile numberand we will give you a call for further details. We usually attend your problems within 60 minutes and solve it in maximum 2 days.