[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Why no metamethods for logical operators?
- From: RLake@...
- Date: Wed, 24 Mar 2004 11:53:05 -0500
> I believe C++ must also decide at runtime.
C++ can tell at compile time because the short-circuit
only applies to primitive types, not classes. (You
a primitive type in C++).
In my opinion, the fact that you can override short-circuiting
operators in C++ is just plain wierd. But the fact
can override , is pretty wierd too. C++ gives you
latitude to write unreadable programs.
In any event, the use of "+" for "or"
and "*" for "and" makes
a lot of sense; few datatypes would require different