Assoc array init

JN 666total at wp.pl
Tue Feb 4 07:52:05 UTC 2020


int[int] a = [5: 7];

void main()
{
}


This fails because apparently [5: 7] is a "non-const expression". 
How? Why?

Yes, I know I can just init in a static this() section, but that 
feels like a bad workaround.


More information about the Digitalmars-d-learn mailing list