Question:medium

Which of the following operators cannot be overloaded?

Show Hint

A simple rule of thumb: operators that work on names rather than values (like.`,::`) cannot be overloaded.
Updated On: Jul 2, 2026
  • ::
  • +
  • =
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Understand what operator overloading means.
Overloading an operator means giving it a new, user-defined meaning when it is used with objects of your own class, so the compiler must be able to tell, from context, which version to call.
Step 2: Identify operators the language reserves for itself.
A handful of operators are hard-wired into the C++ grammar and can never be redefined, including the scope resolution operator ::, the member access operator dot, the pointer-to-member operator, the ternary operator, and sizeof.
Step 3: Match this rule against the given choices.
Addition and assignment are both commonly overloaded for custom classes, but :: is used purely to qualify names, such as ClassName::member or Namespace::name, and its meaning must stay fixed so the compiler can resolve identifiers correctly.
\[ \boxed{::} \]
Was this answer helpful?
0