How do I store an immutable value into a mutable associative array?

PlatisYialos leonidasklados at gmail.com
Tue Nov 6 09:48:54 PST 2012


On Tuesday, 6 November 2012 at 17:23:41 UTC, PlatisYialos wrote:

Errmm!  Here's a better example, but with the same results:

----------------------------
module test;

void noparens() {
   immutable char[char] aMap;
   char a = 'a';
   immutable char b = 'b';
   aMap[a] = b;
}

void withparens() {
   immutable(char)[char] aMap;
   char a = 'a';
   immutable char b = 'b';
   aMap[a] = b;
}
-----------------------------



More information about the Digitalmars-d-learn mailing list