1 matches bool, 2 matches long

Timon Gehr timon.gehr at gmx.ch
Thu Apr 25 14:15:36 PDT 2013


On 04/25/2013 11:05 PM, Ali Çehreli wrote:
> ...
>
> Is bool more specialized than long or is this a bug? Intuitively, both
> should match the 'long' overload.

bool is more specialized than long; you can pass any bool argument as a 
long argument, but not vice versa.

> It feels like there should at least be ambiguity.
> ...

This would be an enhancement. (A possible rule to add would be that 
literal-level conversions cannot influence the chosen overload.)


More information about the Digitalmars-d mailing list