Defining and overriding methods of an abstract base class which must accept a template parameter

pineapple via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 10 14:27:14 PDT 2016


On Sunday, 10 July 2016 at 21:20:34 UTC, Basile B. wrote:
> The problem you encounter here is that templatized functions 
> cannot be virtual. If you remove "abstract" and put an empty 
> body than it works, but you lose the whole OOP thing, i.e you 
> cannot call the most derived override from the base.

Yeah, that was the first thing I tried, and it took me a while 
and some measure of annoyance to realize the base method was 
being called instead of the derived one.

Surely there's some reasonable workaround?


More information about the Digitalmars-d-learn mailing list