There has been much discussion over the years about the usefulness of operator overloading in C++ as well as the ability to get it right.
In reality, it's hard to get it wrong as long as you follow the canonical forms of the operators and don't do unexpected things like overloade the + operator to perform a subtraction operation. Also, the types that your overloaded operators work with should be consistent.
Short answer: don't do it!
Long answer:
As the C++ example from the article on Real World Haskell Chapter 1-2 showed:
#include <iostream> bool getbool(bool b) { std::cout << " getbool called " << std::endl;
Recent comments
16 hours 22 min ago
1 day 22 hours ago
2 days 7 hours ago
1 week 4 days ago
2 weeks 1 day ago
2 weeks 3 days ago
3 weeks 14 hours ago
3 weeks 14 hours ago
3 weeks 2 days ago
4 weeks 8 hours ago