TIL you can overload operator&& and operator|| in C++ and it loses its short-circuiting capability if you do
@whitequark Operator overloading is just terrible, at least unless you restrict it to certain operators it makes sense for (mainly arith.).
-
-
@whitequark E.g. || and && should inherently coerce operands to bool and thereby never be overloadable (except indirectly via conv-to-bool). -
@RichFelker operator overloading is particularly bad when it's together with OOP -
@RichFelker if all overloaded operators are lexically bound, it's ok
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.