Re: Finding out about D - 102

2009-05-11 Thread Steve Teale
Ary Borenszweig Wrote: > Steve Teale wrote: > > OK, so structs are a different beast in D than they are in C++. This > > results in one of my most common pitfalls. I'll find myself writing: > > > > struct A > > { > >int a; > >int b; > > } > > > > A[] nameTooLong = ...; > > > > foreach

Re: Finding out about D - 102

2009-05-11 Thread Jarrett Billingsley
On Mon, May 11, 2009 at 1:48 PM, Steve Teale wrote: > Then I chase a bug in my program, which compiled OK. After some time, I > realize that > >   A ntl = nameTooLong[whatever.whatever]; > > is doing a copy, which is not what I was thinking about at all - old C++ > habits. Um, C++ works exactl

Re: Finding out about D - 102

2009-05-11 Thread Ary Borenszweig
Steve Teale wrote: OK, so structs are a different beast in D than they are in C++. This results in one of my most common pitfalls. I'll find myself writing: struct A { int a; int b; } A[] nameTooLong = ...; foreach (whatever; thingie) { nameTooLong[whatever.whatever].a = whatever.x*3

Finding out about D - 102

2009-05-11 Thread Steve Teale
OK, so structs are a different beast in D than they are in C++. This results in one of my most common pitfalls. I'll find myself writing: struct A { int a; int b; } A[] nameTooLong = ...; foreach (whatever; thingie) { nameTooLong[whatever.whatever].a = whatever.x*3; nameTooLong[what