

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Questions & Answers
- 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?
- Smallest positive value that cannot be represented as sum of subarray JavaScript
- Why constructor cannot be final in Java
- Why a constructor cannot be final in Java?
- How to clear a chart from HTML5 canvas so that hover events cannot be triggered?
- Fix for java.math.BigInteger cannot be cast to java.lang.Integer?
- What are the different ways for a method to be overloaded in C#?
- Return 5 random numbers in range, first number cannot be zero - JavaScript
- Overloaded method and ambiguity in C#
- What are overloaded indexers in C#?
- Find the smallest positive integer value that cannot be represented as sum of any subset of a given array in Python
- Why variables defined in try cannot be used in catch or finally in java?
Advertisements