http://d.puremagic.com/issues/show_bug.cgi?id=2544





------- Comment #1 from la...@virginia.edu  2009-01-01 20:31 -------
I included an unnecessary level of indirection before.  A simpler example:
----
const(int)[] answers = [42];       // create const data
int[][] unconsted = [[]];          // create mutable data
const(int)[][] unsafe = unconsted; // and a partially-constant view of it
unsafe[0] = answers;               // place const data in the const view
unconsted[0][0] = 43;              // change const data
----
Thus, while "const(T)[] = T[]" is safe, "const(T)[][] = T[][]" is not; only a
single level of implicit indirection in the cast preserves constness.


-- 

Reply via email to