bitwise:

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?

You meant to say "associative array with const objects as values". I think the short answer is that you can't. This is a breaking change, I think, it broke some of my code too. But perhaps something like Rebindable could be used.

Bye,
bearophile

Reply via email to