Templated class requires values even though having default value

Adam D. Ruppe destructionator at gmail.com
Sun May 9 12:19:37 UTC 2021


On Sunday, 9 May 2021 at 10:53:49 UTC, tcak wrote:
> The "dim" template parameter has a default value of 1 already. 
> Why does it still force me to give a value?

It doesn't, but it does require you to instantiate the template. 
You can do `OpenClKernel!()` to use the default value.

But without that ! instantation, you're just referring to a 
template name, not a class.

You might want to try something like

class GenericOpenClKernel(....) {}

alias OpenClKernel = GenericOpenClKernel!();


depending on the intended uses.


More information about the Digitalmars-d-learn mailing list