- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Operators that cannot be overloaded in C++
In C++ we can overload some operators like +, -, [], -> etc. But we cannot overload any operators in it. Some of the operators cannot be overloaded. These operators are like below
- ? “.” Member access or dot operator
- ? “? : ” Ternary or conditional operator
- ? “::” Scope resolution operator
- ? “.*” Pointer to member operator
- ? “sizeof” The object size operator
- ? “typeid” Object type operator
These operators cannot be overloaded because if we overload them it will make serious programming issues.
For an example the sizeof operator returns the size of the object or datatype as an operand. This is evaluated by the compiler. It cannot be evaluated during runtime. So we cannot overload it.
- Related Articles
- Functions that cannot be overloaded in C++
- Functions that can’t be overloaded in C++
- Can main() be overloaded in C++?
- How to implement Python __lt__ __gt__ custom (overloaded) operators?
- What are the different ways for a method to be overloaded in C#?
- What are overloaded indexers in C#?
- Overloaded method and ambiguity in C#
- Rolling of chapati and baking of chapati are the changes that(a) can be reversed(b) cannot be reversed(c) can be reversed and cannot be reversed, respectively(d) cannot be reversed and can be reversed, respectively
- Why in MySQL, we cannot use arithmetic operators like ‘=’, ‘
- Neutralization reaction is a(a) physical and reversible change(b) physical change that cannot be reversed(c) chemical and reversible change(d) chemical change that cannot be reversed
- Paheli’s mother made a concentrated sugar syrup by dissolving sugar in hot water. On cooling, crystals of sugar got separated. This indicates aphysical change that can be reversedchemical change that can be reversedphysical change that cannot be reversedchemical change that cannot be reversed.
- Hiding of all overloaded methods in base class in C++
- Smallest positive value that cannot be represented as sum of subarray JavaScript
- Why cannot solids be compressed?
- Tearing of paper is said to be a change that cannot be reversed. What about paper recycling?

Advertisements