BigInt bool assign

Mr. Anonymous mailnew4ster at gmail.com
Fri Dec 23 13:44:35 PST 2011


On 23.12.2011 14:42, bearophile wrote:
> D language regards boolean values as a subset of integers so it allows implicit conversion from bool to integer, but not from int to bool. I don't think this will ever change in D2/D3:

Discussing about pros and cons of such implicit conversion is one thing, 
but that's already how it works for basic types, so I agree it must work 
for more advanced ones.
After all, BigInt is a big int, and it should feel like that. If one 
expects a += (b < c); to work for an int (and it works), it should work 
for BigInts as well.
Another option is also disabling it for basic types, but better not 
define different behavior for similar types.


More information about the Digitalmars-d mailing list