February 2022
Beginner
848 pages
22h 40m
English
In addition to encapsulating data and methods, a class can also encapsulate operators that make it easy to operate on instances of the class. You can use these operators to perform operations such as assignment or addition on class objects similar to those on integers that you saw in Lesson 5, “Working with Expressions, Statements, and Operators.” Just like functions, operators can also be overloaded.
In this lesson, you learn:
■ The keyword operator
■ Unary and binary operators
■ Conversion operators
■ The move assignment operator
■ Operators that cannot be redefined
On a syntactical level, there is very little that differentiates an operator from a ...
Read now
Unlock full access