defaulting leading template parameters?

Sean Kelly sean at f4.ca
Wed Oct 25 15:59:09 PDT 2006


d-bugmail at puremagic.com wrote:
> 
> void testfunc(DUMMY = void, T)(int x, T a) {
>     writefln("x = %d, a = %s", x, a);
> }

I had no idea this was legal--it isn't in C++.  I guess the rationale is 
that if the compiler can figure out the remaining parameters by 
inspecting function arguments then this is not an error?


Sean



More information about the Digitalmars-d-bugs mailing list