1 matches bool, 2 matches long

deadalnix deadalnix at gmail.com
Fri Apr 26 03:18:59 PDT 2013


On Friday, 26 April 2013 at 08:03:14 UTC, Walter Bright wrote:
> On 4/25/2013 11:16 PM, deadalnix wrote:
>> This "feature" never has been useful to me.
>
> It has been useful to me. So there!
>
>> It has caused bug.
>
> The bug is not providing an overload for int.
>
>> Additionally, the behavior is inconsistent :
>>
>> int i = 1;
>> foo(i); // Don't call the bool version.
>
> It is not inconsistent - you forgot a foo(int) overload. '1' is 
> an int. If you don't supply and int overload, it must 
> implicitly convert, and those conversions are considered 
> equivalent.

Because bool value range should be used as a failover mecanism 
IMO. And bool shouldn't be considered as an integral.


More information about the Digitalmars-d mailing list