array of constants?

Lloyd Dupont ld-REMOVE at galador.net
Thu Jun 2 09:13:46 PDT 2011


I'm trying to define an array of constant like:

===
immutable string[int] MyDict = [
    1: "monday",
    2: "tuesday",
    ];

====
And I keep having compiler error:

Error    1    Error: non-constant expression [1:"monday",2:"tuesday"] 
C:\Dev\DTest\DTest1\Dexperiment\LCIDs.d    9

what can I do? how do I do that? 



More information about the Digitalmars-d-learn mailing list