Template specialization question

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Nov 24 09:47:04 PST 2016


void foo(T)(T t){writeln("a");}
void foo(T...)(T t){writeln("b");}

foo(1);

Compiles? If so, which prints out?

I was surprised by the answer. I can't find docs for it. Is the behavior 
intended?

-Steve


More information about the Digitalmars-d-learn mailing list