---
title: "Operators that cannot be overloaded"
subject: "Object Oriented Programming"
chapter: 5
key: "semester_3/object_oriented_programming:non-overloadable-operators"
source: https://www.bctengineer.com/q/semester_3/object_oriented_programming/non-overloadable-operators
site: BCT Engineering
---

# Operators that cannot be overloaded

Object Oriented Programming · Chapter 5: Operator Overloading

- Asked in: 2072 Chaitra, 2 marks; 2068 Chaitra, 2 marks (asked 2 times)
- Video: [Understanding the Rules and Restrictions for Overloading Operators in C++](https://www.youtube.com/watch?v=aHVYtTmlzeY) — vlogommentary
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/object_oriented_programming/non-overloadable-operators
- Whole chapter: https://www.bctengineer.com/md/semester_3/object_oriented_programming/chapter-5

## Question

What are the non-overloadable operators in C++?

## Short answer

Operators that cannot be overloaded are :: (scope resolution), . (member access), .* (pointer-to-member), ?: (ternary), sizeof, and typeid. These operate on names or types, not values, and overloading would compromise language safety.

## Answer

Most C++ operators can be overloaded, but the following **cannot** be overloaded:

| Operator | Name |
|---|---|
| `::` | Scope resolution operator |
| `.` | Member access (dot) operator |
| `.*` | Pointer-to-member operator |
| `?:` | Conditional (ternary) operator |
| `sizeof` | Size-of operator |
| `typeid` | Run-time type information operator |

The cast operators `const_cast`, `dynamic_cast`, `static_cast` and `reinterpret_cast`, and the preprocessor symbols `#` and `##`, also cannot be overloaded.

**Reason:** these operators work on names or types (not values), or their meaning is fixed by the language, so changing them could make the language unsafe or ambiguous. Also, the precedence, associativity and number of operands of an operator cannot be changed by overloading, and new operator symbols cannot be created.

Note: `=`, `[]`, `()` and `->` can be overloaded, but only as member functions.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which cannot be overloaded?
   A. +
   B. ::
   C. <<
   D. []
   Answer: B. ::, ., .*, ?:, sizeof, typeid cannot be overloaded. (Key point: Non-overloadable)

2. Which cannot be changed by overloading?
   A. Precedence and number of operands
   B. The function body
   C. Return type
   D. Argument type
   Answer: A. Precedence, associativity and operand count are fixed. (Key point: Fixed properties)

3. Which can be overloaded but only as member?
   A. ?:
   B. []
   C. sizeof
   D. ::
   Answer: B. =, [], () and -> must be members. (Key point: Member-only)

## Related in Object Oriented Programming

- [Overloadable operators in C++](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Aoverloadable-operators) — Object Oriented Programming, chapter 5
