From: Andrew P. L. <bs...@ma...> - 2002-06-13 06:11:34
|
On Wed, 12 Jun 2002, Scott Gilbert wrote: > C++ has overloadable && and || operators, but overloading them is frowned > on by many. C++ has the advantage over Python in that it knows the actual > types at compile time. Actually, overloading && and || isn't just frowned upon in C++, it's effectively banned. The reason is that it replaces short-circuit semantics with function call semantics and screws up the standard idioms (if ((a != NULL) && (*a == "a")) { ... } ). See "Effective C++" by Scott Meyers. As far as I know, *none* of the C++ literati hold the opposing view. -a |