Associative array to Struct at compile time
bearophile via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Jul 25 08:33:27 PDT 2014
BlackEdder:
> Is this possible at all?
I think it's possible, as long as your associative array contents
are known at compile-time. You can write a function that given
the associative array returns a string that mixed-in defines the
struct. And then you can define a toStruct template.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list