digitalmars.D.learn - immutable arrays and .sort/.reverse
- simendsjo (6/6) Apr 02 2011 immutable(int[]) a = [1,2,3];
- bearophile (4/7) Apr 02 2011 It's a known bug, already in Bugzilla.
immutable(int[]) a = [1,2,3]; assert(!is(typeof({a[0] = 0;}))); // cannot change elements assert(!is(typeof({a = [1,1,1];}))); // cannot rebind // but I'm allowed to sort in place... a.reverse; assert(a == [3,2,1]);
Apr 02 2011
simendsjo:// but I'm allowed to sort in place... a.reverse; assert(a == [3,2,1]);It's a known bug, already in Bugzilla. Bye, bearophile
Apr 02 2011