[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- 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
behaviour
only applies to primitive types, not classes. (You
cannot subclass
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
that you
can override , is pretty wierd too. C++ gives you
lots of
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
semantics.
Rici.