1 matches bool, 2 matches long
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sun Apr 28 15:40:35 PDT 2013
On 4/28/13 5:41 PM, kenji hara wrote:
> Yes, as Andrei mentioned, it is sometimes useful. But, at least during
> overload resolution, it must not occur.
>
> Kenji Hara
Well the problem has other ramifications beyond bool. Consider:
import std.stdio;
int fun(short v1) { return 1; }
int fun(long v1) { return 2; }
void main(string[] args)
{
writeln(fun(10_000));
writeln(fun(100_000));
}
This prints "1 2". So the behavior of bool in this case is consistent
with the behavior of other integral types.
Andrei
More information about the Digitalmars-d
mailing list