Chapter 22. Operator Overloading
After completing this chapter, you will be able to
Implement binary operators for your own types.
Implement unary operators for your own types.
Write increment and decrement operators for your own types.
Understand the need to implement some operators as pairs.
Implement implicit conversion operators for your own types.
Implement explicit conversion operators for your own types.
You have made a great deal of use of the standard operator symbols (such as + and –) to perform standard operations (such as addition and subtraction) on types (such as int and double). Many of the built-in types come with their own predefined behaviors for each operator. You can also define how operators should behave for your own structures ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access