It’s tempting to become
overenthusiastic with operator overloading. It’s a fun toy, at first. But
remember it’s only syntactic sugar, another way of calling a
function. Looking at it this way, you have no reason to overload an operator
except if it will make the code involving your class easier to write and
especially easier to read. (Remember, code is read much more than it is
written.) If this isn’t the case, don’t bother.
Another common response to operator
overloading is panic; suddenly, C operators have no familiar meaning anymore.
“Everything’s changed and all my C code will do different
things!” This isn’t true. All the operators used in expressions that
contain only built-in data types cannot be changed. You can never overload
operators such that