Template with default parameter

Andrey Zherikov andrey.zherikov at gmail.com
Fri Mar 11 12:01:27 UTC 2022


There is some inconsistency between templates and template 
functions as this works as I want to:
```d
import std.stdio;

void f(int i=3)()
{
     writeln(i);
}

void main()
{
     f!1;  // 1
     f!(); // 3
     f;    // 3
}
```


More information about the Digitalmars-d-learn mailing list