Operator Overloading

C++ allows you to write custom behaviors for operators like +, -, & → etc. in the language.

Generally speaking for application code this is a bad idea since it makes it hard to understand when a custom method or function is being called. For very limited library applications it can be helpful.

For instance if you had a library for doing matrix operations, one could overload the + and * operations to define matrix addition and multiplication.

We use operator overloading for smart pointers in our code base.