Static Associative Array

Jonathan M Davis jmdavisProg at gmx.com
Sun Mar 6 16:58:44 PST 2011


On Sunday 06 March 2011 16:30:00 Andrej Mitrovic wrote:
> What about:
> 
> enum : string[int]
> {
>     aa = [1: "blue", 2: "red"]
> }
> 
> enum string s = aa[1];
> 
> void main()
> {
>     writeln(s);
> }

In both cases, the AA does not exist past compile time. That may be why it 
works.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list