1 matches bool, 2 matches long

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Apr 26 13:59:43 PDT 2013


On 4/26/13, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> An even better example:

import std.stdio;

void foo(bool x) { writeln("1"); }
void foo(long x) { writeln("2"); }

void main()
{
    foo(1);  // "1"
    foo(false ? 2 : 1);  // "2"
}

Kill it with fire.


More information about the Digitalmars-d mailing list