Swipe to navigate through the chapters of this book
IN THIS CHAPTER, you’ll learn how to add support for operators such as add and subtract to your classes so that they can be applied to objects. This will make the types that you define behave more like fundamental data types and offer a more natural way to express some of the operations between objects. You’ve already seen how classes can have function members that operate on the data members of an object. Operator overloading enables you to write function members that enable the basic operators to be applied to class objects.
Please log in to get access to this content
To get access to this content you need the following product:
- Operator Overloading
- Sequence number
- Chapter number
- Chapter 12