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
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
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
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