Compile-time immutable AA?

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Fri Aug 2 18:52:01 PDT 2013


On Friday, 2 August 2013 at 21:57:14 UTC, Syniurge wrote:
> // The rest below is for compile time only
>
> private immutable string[TypeIndex] TyIdxtoDType = [
>     TypeIndex.Nil : "DynamicValue",
>     TypeIndex.Number : "Number",
>     TypeIndex.String : "string",
>     TypeIndex.Table : "TableHeader*",
>     TypeIndex.Classinst : "ClassHeader*",
>     TypeIndex.Function : "FunctionValue*",
>     TypeIndex.Bool : "bool"
> ];

Pretty sure you just need to start that with:

private enum TyIdxtoDType = [


More information about the Digitalmars-d-learn mailing list