Template sequence parameter and default value

Andrey Zherikov andrey.zherikov at gmail.com
Thu Jan 27 02:49:22 UTC 2022


What is the best way to emulate a default value for template 
sequence parameter of a function?

I want something like this:
```d
void foo(MODULES... = __MODULE__)() {}

// these should work:
foo!(module1, module2);
foo!(module1);
foo();          // this should use current module (__MODULE__) 
according to default value
```



More information about the Digitalmars-d-learn mailing list