RedZone: > But it would be nice if I could have the array reference itself be immutable > and not just the array's contents. Is there any way I could do this?
Let's say your code is as your second example:
class Foo {
private:
immutable int[string] bar;
public:
this() {
bar = ["AB":1, "CD":2, "EF":3];
}
}
void main() {
auto f = new Foo;
}
How can you change the array reference outside the class constructor?
Bye,
bearophile
