class scope virtual template functions
BCS
ao at pathlink.com
Fri May 30 08:09:24 PDT 2008
Reply to janderson,
> 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).
>
> Of course that's more complex then a simple template virtual
> inheritance however it does provide more functionality as well.
>
> -Joel
>
It would be simpler to use a string mixin to generate functions with the
string encoded into the function name. It could get ugly but a non virtual
template function could get around that. But still, the proposed solution
is "possible" and a lot cleaner.
More information about the Digitalmars-d
mailing list