Is this kinds stuff a sane thing to do, or does it just work by accident?:
void modify(ubyte[] dynamicArr) { dynamicArr[$-1] = 5; } void main() { ubyte[4] staticArr = [1,1,1,1]; modify(staticArr); assert(staticArr == [1,1,1,5]); }
Nick Sabalausky via Digitalmars-d-learn Mon, 05 May 2014 19:16:33 -0700
Is this kinds stuff a sane thing to do, or does it just work by accident?:
void modify(ubyte[] dynamicArr) { dynamicArr[$-1] = 5; } void main() { ubyte[4] staticArr = [1,1,1,1]; modify(staticArr); assert(staticArr == [1,1,1,5]); }