constness for arrays

xs0 xs0 at xs0.com
Wed Jul 19 01:21:29 PDT 2006


> int[] cowFoo(int[] a) { if (whatever) { a=a.dup; a[0] = 5; } }
> int[] cowBar(int[] a) { if (something) { a=a.dup; a[1] = 10; } }

Of course, both return a as well :)

xs0



More information about the Digitalmars-d mailing list