class scope virtual template functions

Chris Wright dhasenan at gmail.com
Fri May 30 05:40:10 PDT 2008


janderson wrote:
> You could use a functor/proxy type thing.  That is return a separate 
> object for each class level that has opCall overloaded.  The opCall 
> could be templated.  The functor object probably could be generalized so 
> that you could use it in any case you needed a virtual function (it 
> could callback its owner by template or maybe delegate).

I don't understand this. You seem to be suggesting moving the template 
to a functor and having inheritors of the original class return a 
different functor. But unless that functor is virtual, you simply can't 
do that. You'd need to call a different method for each inheritor, or 
you'd need inheritance with the functors. The former is not virtual; the 
latter simply returns us to the original problem.



More information about the Digitalmars-d mailing list