this T / variadic template and interfaces

Jacob Carlborg doob at
Mon Oct 26 13:02:33 UTC 2020

On Monday, 26 October 2020 at 11:14:47 UTC, frame wrote:

> Is there any way to get this working? I know, I could use a 
> known object to feed the arguments and use that instead - but I 
> want to keep things simple as possible.

As Simen mentioned, templates cannot be virtual. But you don't 
need to use a template, you can use a regular variadic method 
[1]. It's a bit more clunky to work with than template variadic 
functions. Or if all the arguments will be of the same type, you 
can use type safe variadic functions [2], which are easier to 
work with.


/Jacob Carlborg

More information about the Digitalmars-d-learn mailing list