Pass type directly to a template function?

Dukc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 7 13:40:04 PST 2017


On Tuesday, 7 February 2017 at 10:21:20 UTC, Mike Parker wrote:
>>     function2!float(); //?
>>     function3!float(); //?
>
> Yes, this is how it's done.

Not quite with function3, because it takes one unnamed runtime 
parameter. It can be called like function1 however. The value of 
the parameter does not matter because it's unused, only the type.




More information about the Digitalmars-d-learn mailing list