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;
   nameTooLong[whatever.whatever].b = whatever.y/3;

with(nameTooLong[whatever.whatever]) {
  a = whatever.x*3;
  b = whatever.y/3;
}

Reply via email to