Template functions inside interface

Adam D. Ruppe destructionator at gmail.com
Tue Aug 4 13:39:41 UTC 2020


On Tuesday, 4 August 2020 at 13:36:15 UTC, Zans wrote:
> Is there any way to declare template functions inside interface 
> and then override them in a class?

No, the templates in the interface are automatically considered 
`final`. So the body must be in the interface too to avoid that 
undefined reference error.

You can have them forward to normal methods in the interface 
though, just there needs to be a fixed number of them with 
concrete types.


More information about the Digitalmars-d-learn mailing list