On Sun, 25 Dec 2011 02:50:15 +1100, Timon Gehr <[email protected]> wrote:

Although BOOL is typed as 'int', it really has the semantics of 'bool'.
We have an example of this in D1's opEquals().
I think this is reason why implicit conversion bool -> int exists.

It exists because it is handy and makes sense. Would you also want to ban implicit short -> int conversion?

A 'short' is a type of integer, an 'int' is a type of integer, but a 'bool' is NOT a type of integer.

One can do arithmetic with two integers but what does 'TRUTH * TRUTH' mean? Or what does 'FALSEHOOD - TRUTH' mean?

--
Derek Parnell
Melbourne, Australia

Reply via email to