What are the restrictions on operator overloading in C++?
Which operators cannot be overloaded in C++ ?
Answer:[1]
1. It must have at least one user defined type. To prevent overloading of default types.
2. You cannot use an operator that violates the normal usage syntax, for ex: "% userDefinedType" is invalid.
3. The following operators cannot be overloaded, sizeof() typeid() :: . .* ?: const_cast dynamic_cast reinterpret_cast static_cast.
No comments:
Post a Comment