On Monday, 2 May 2016 at 17:50:50 UTC, tsbockman wrote:
On Monday, 2 May 2016 at 17:37:14 UTC, Basile B. wrote:
templatized functions in classes will never be virtual and
there's a technical reason explained here:
https://issues.dlang.org/show_bug.cgi?id=1657#c1
(TL;DR: it's problematic to generate the vtbl)
[...]
That's not how it works currently, but there is no technical
reason it couldn't be *made* to work that way.
Obviously this would be a breaking change though; `this T`
template methods that should retain the current behaviour could
be marked `final`. (Given that non-template methods are virtual
by default, I think requiring template methods to be marked
`final` would improve code clarity, anyway.)
Not that much a breaking change. Perhaps a slight decrease of the
performances...and even not indeed: in all the previous usages
devirtualization of the will be possible.