abstract function templates

Simen kjaeraas simen.kjaras at gmail.com
Tue Dec 28 14:06:19 PST 2010


bearophile <bearophileHUGS at lycos.com> wrote:

> (I don't know why templated methods can't be virtual)

First of all, they can. But it's a shitload of extra work, and requires
that compilation be  mixed up with linking.

Whenever a templated method is used from any subclass, it has to be
generated for the base class, and any and all subclasses that override
it. We can't know every subclass until link-time (not even then, given
dynamic linking).


-- 
Simen


More information about the Digitalmars-d-learn mailing list