January 2011
Intermediate to advanced
1648 pages
70h 30m
English
We’re almost at the end of our journey through the world of class and struct members. Possibly the most powerful member type (but not quite as powerful as the same notion in languages such as C++) are operator overloads. Basically, operator overloads are special static methods that can be invoked as a result of using operator syntax such as +, && (a very special one consisting of two operator invocations, as you will see), ==, and so on.
Using this feature, it becomes possible to provide more natural-looking and convenient syntax for various operators a type can support on its instances. Vectors are a great example of this:

Read now
Unlock full access