<<< Caution: when operator overloading can hurt your users | Index | Advice >>> |
When you overload logical
operator&& operator||
operators, the operands must be evaluated, which isn't the way things normally work with short circuiting of built-in types.
This creates programmer astonishment and bugs.
This is why it is generally bad to overload these operators!
See also:
<<< Caution: when operator overloading can hurt your users | Index | Advice >>> |