On Sat, Apr 4, 2009 at 12:15 PM, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote: > Georg Wrede wrote: >> >> 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...) >>> { >>> ... >>> } >> >> Hmm. An idiom. My sweet tooth just got thirsty for syntactic sugar! > > When opImplicitCastFrom will be implemented, foo's definition will be > enough. You'll write foo(1, 2.3, "a") and the compiler will rewrite it to > foo(Variant(1), Variant(2.3), Variant("a")). > > Andrei
Oh wow, I missed this in the flood. I'm very happy about this indeed!