struct Test{ immutable size_t id; } Test[string] dict; Test[] array;
void main(){ array~=Test(1);//work dict["teste"] = Test(1); //fail ?? }"Error: cannot modify struct dict["teste"] Test with immutable members"
Why?
Patric Dexheimer via Digitalmars-d-learn Wed, 05 Oct 2016 18:26:44 -0700
struct Test{ immutable size_t id; } Test[string] dict; Test[] array;
void main(){ array~=Test(1);//work dict["teste"] = Test(1); //fail ?? }"Error: cannot modify struct dict["teste"] Test with immutable members"
Why?