Member-assignment for std.container.Array!Struct

Matthias Walter xammy at xammy.info
Thu Jan 9 23:36:57 PST 2014


Hi,

about 2 years ago I stopped using D for my projects since there were too
many bugs that hindered me from making quick progress. Since I got
several mails from bugzilla about those bugs being fixed I wanted to
give it another try. Unfortunately, the following non-working code made
me think to stop using it once again:

struct S
{
  int i;
}
Array!S array = [ S(0) ];
array[0].i = 1;

The reason is certainly that the change only affects a copy and not the
true array-member. I remember that there was a discussion about sealed
containers and returning references, etc.

My question is now: Has there been any progress in this direction? I
know that the design of ref's semantics is a nontrivial topic, but on
the other hand in my opinion std.container.Array is completely useless
if not even the above code works as one would expect!

Best regards,

Matthias


More information about the Digitalmars-d mailing list