Hacker News new | ask | show | jobs
by TheCoelacanth 4223 days ago
Operator overloading is useful for a lot more than just math. Overloading * and -> is useful for pointer-like types. Overloading () is useful for function-like types. Overloading [] is useful for collections and overloading ++ and -- is useful for iterators.
1 comments

The overloading of (), [], and the like is used but it's not necessary. They could have been other named overloaded functions.