Automatic dynamic dispatch

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Feb 5 20:51:02 PST 2013


On 2/6/13, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> void callFunc(alias func, Args...)(Args args)
> ...
>     foreach (Base; ClassTree!(C, D))

Also this was hardcoded for these two leaf classes but it wouldn't be
too hard to provide a generic template with which you could do:

alias AutoDispatch!(C, D) Dispatch;
alias Dispatch!func myFunc;
A a = new C;
myFunc(a);


More information about the Digitalmars-d mailing list