About This eBook by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Which Operators Can Be Overloaded?

Lots of operators support being overloaded by the developer of classes and structs. Although I could show examples of all of them, I’ll limit myself to illustrating a couple of special ones. We also discuss how certain expressions that use operators (such as && or ?:) are turned into uses of multiple custom operators.

A Mandatory Listing

An exhaustive list of all the operators that can be overloaded is shown here. All but a few should look pretty straightforward. The others are the subject of further discussion in the following sections.

Image Unary operators: +, -, ~, !, ++, --, true, false

Binary operators:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required