Practice mode C++

Which of these C++ operators can NOT be overloaded?

Correct answer A. ?: (conditional operator)

Explanation

Most operators can be overloaded, including [], (), and compound assignments such as +=. A few cannot: the conditional ?:, member access ., pointer-to-member .*, scope resolution ::, and sizeof, alignof and typeid. These are excluded because they operate on names or types rather than values, or because overloading them would break fundamental language rules.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.