Objective-D, reflective programming, dynamic typing

Christopher Wright dhasenan at gmail.com
Sat Apr 4 09:06:53 PDT 2009


Andrei Alexandrescu wrote:
> void foo_templated(T...)(T args)
> {
>    Variant[args.length] dynatyped;
>    foreach (i, arg; args) dynatyped[i] = arg;
>    return foo(dynatyped);
> }
> void foo(Variant[] dynatyped...)
> {
>    ...
> }
> 
> Andrei

Okay, that's a reasonable solution, except that it doesn't work with 
interfaces. I already submitted a bugzilla entry that you should be able 
to create a Variant[] from D varargs, but that still requires writing a 
wrapper function.



More information about the Digitalmars-d mailing list