Lots of bool operations shouldn't compile
Don Clugston
dac at nospam.com.au
Tue Feb 28 05:51:04 PST 2006
Four examples, although it's only one bug. Almost all operations on bool
should be disabled, but I found the ones below a little amusing. None of
them should compile, but they all evaluate as "true".
void main()
{
if (true >= ireal.nan) { writefln("This is kind of ridiculous"); }
if (false >= ireal.nan) { writefln("This is kind of ridiculous"); }
if (true <> -2i) { writefln("NCEG operators too ??!!"); }
if (false != -2i) { writefln("and again"); }
}
More information about the Digitalmars-d-bugs
mailing list