Associative Array of Const Objects?

bitwise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Mar 27 14:33:17 PDT 2015


class Test{}

void main()
{
	const(Test)[string] tests;
	tests["test"] = new Test();
}

This code used to work, but after upgrading to dmd 2.067, it no 
longer does.
--Error: cannot modify const expression tests["test"]

How do I insert an item into an associative array of const 
objects?


More information about the Digitalmars-d-learn mailing list