We’re almost at the end of our journey through the world of class and struct members. In the previous chapters, we covered fields, properties, methods, and constructors as the member types you’ll be using on a daily basis.

But we haven’t yet covered what could be the most powerful member type in terms of expressiveness for users of our types. Those are operator overloads. Basically, operator overloads are special static methods that can be invoked as a result of using operator syntax such as +, &&, ==, 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:

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.