BigInt bool assign
Derek
ddparnell at bigpond.com
Sat Dec 24 08:02:33 PST 2011
On Sun, 25 Dec 2011 02:50:15 +1100, Timon Gehr <timon.gehr at gmx.ch> 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
More information about the Digitalmars-d
mailing list