Apparently using ref array parameters/implicit conversions gets around const in this example.
void popFront(T)(ref T[] arr) {
arr = arr[1..$];
}
void main() {
immutable arr = [1,2,3,4,5].idup;
arr.popFront();
assert(arr == [2,3,4,5]); // PASSES
}
Please take your time fixing this, though, as much of std.range relies on this bug to work correctly with const/immutable arrays.
Comment #1 by smjg — 2010-09-17T05:17:42Z
*** This issue has been marked as a duplicate of issue 3534 ***