dcollections 1.0 and 2.0a beta released
BCS
none at anon.com
Fri May 21 20:34:01 PDT 2010
Hello Bill,
> On Fri, May 21, 2010 at 9:43 AM, Steven Schveighoffer
> <schveiguy at yahoo.com> wrote:
>
>> void foo(int[int] x)
>> {
>> x[5] = 5;
>> }
>> void main()
>> {
>> int[int] x;
>> foo(x);
>> assert(x[5] == 5); // fails
>> }
> And with arrays at least it's even more insidious, because sometimes
> it will seem to work, and sometimes it won't.
> void foo(int[] x) {
> x ~= 10;
> }
> Caller's .length will never get updated by that, but it won't crash so
> it may take a while to find the bug.
Maybe the style rule should be: dynamic arrays and AA's should be passed
as const or ref.
--
... <IXOYE><
More information about the Digitalmars-d-announce
mailing list