1 matches bool, 2 matches long

deadalnix deadalnix at gmail.com
Fri Apr 26 07:33:18 PDT 2013


On Friday, 26 April 2013 at 08:00:28 UTC, Walter Bright wrote:
> On 4/26/2013 12:07 AM, Maxim Fomin wrote:
>> Regarding bool type as integer type is C atavism and should be 
>> abandoned.
>
> There's a very loooong history of 0 being regarded as false and 
> 1 as true - it goes well beyond C.
>

That is true, but even in theses elder languages, bool is handled 
as a special case, and not as an regular integral type. For 
instance, when integral conversion to smaller type is done by 
applying a mask (or doing a modulo, this is the same thing in 
this case) it is done by comparing to 0 to compare to bool.


More information about the Digitalmars-d mailing list