1 matches bool, 2 matches long

Minas Mina minas_mina1990 at hotmail.co.uk
Fri Apr 26 04:58:48 PDT 2013


On Friday, 26 April 2013 at 06:01:27 UTC, Walter Bright wrote:
> On 4/25/2013 10:49 PM, Ali Çehreli wrote:
>> It certainly behaves that way but it isn't an integer type and 
>> that's why it is
>> unintuitive.
>
> But it is an integer type.

It is an integral type _internally_.
A bool type should have the values true/false. When someone sees 
foo(45) he expects it to call an overload that receives an 
_integral_ value. Which overload is going to be called is a 
detail (short or long in this example). It is confusing to call 
an overload that takes bool. Boolean are true/false, not 0, 1 or 
anything else.


More information about the Digitalmars-d mailing list