Associative arrays give compile error

bearophile bearophileHUGS at lycos.com
Tue Oct 5 16:45:11 PDT 2010


> /*immutable*/ E_MODE[string] a_mode;
> 
> static this () {
>     foreach (m; __traits(allMembers, E_MODE))
>         mixin(`a_mode["` ~ m ~ `"] = E_MODE.` ~ m ~ `;`);
> }

How do you build an immutable AA that is global or local to a function?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list