1 matches bool, 2 matches long

Mehrdad wfunction at hotmail.com
Sun Apr 28 13:54:37 PDT 2013


On Sunday, 28 April 2013 at 19:19:53 UTC, Walter Bright wrote:
> On 4/27/2013 2:58 PM, jerro wrote:
>> On Saturday, 27 April 2013 at 21:52:30 UTC, Walter Bright 
>> wrote:
>>> On 4/27/2013 2:29 PM, Rob T wrote:
>>>> If bools are 1 bit ints, then why do we have 'true' and 
>>>> 'false' as keywords?
>>>
>>> Because writing cast(bool)0 and cast(bool)1 is unappealing.
>>
>> I would expect boolean literals to be something like 0b and 
>> 1b, not true and false then.
>
> To reiterate, history amply shows that if 'true' and 'false' 
> are not there, then people will define them themselves, 
> inconsistently, and the end result is not helpful to anybody.


History also amply shows that having a 'bool' data type that 
tries to behave like a 'bit' data type also leads to frustration.

See:
- This thread
- std::vector<bool>


More information about the Digitalmars-d mailing list