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
3 weeks 16 hours ago
3 weeks 2 days ago
4 weeks 3 days ago
4 weeks 4 days ago
4 weeks 4 days ago
9 weeks 4 days ago
12 weeks 1 day ago
12 weeks 5 days ago
13 weeks 1 day ago
13 weeks 1 day ago