The restriction is for safety.For example if we overload . operator then we cant access member in normal way for that we have to use ->.
Andrew Berstan
Aug 12th, 2006
Because it will not help write a clear program. If we overload sizeof, :?, ::, it will cause a lot of confuse rather than make program more easier to understand.
Amritanshu Agrawal
Sep 5th, 2006
Hi all,
Firstof all only .,:: and .* operators never be overladed.
Because They take name, rather than a value,as their socound operand and provide the primary means of reffering to members.Allowing them to be overloaded would lead to subtlety.
Why cann't we overload the sizeof, :?, :: ., .* operators in c++