Re: Strange behavior when concatenating array

2011-06-17 Thread Steven Schveighoffer
On Fri, 17 Jun 2011 18:52:05 -0400, Timon Gehr wrote: Steven Schveighoffer wrote: https://github.com/D-Programming-Language/druntime/pull/29 See if that helps. On my system, your code now results in your expected output. -Steve If the compiler optimizes well enough the output given could

Re: Strange behavior when concatenating array

2011-06-17 Thread Timon Gehr
Steven Schveighoffer wrote: > https://github.com/D-Programming-Language/druntime/pull/29 > > See if that helps. On my system, your code now results in your expected > output. > > -Steve If the compiler optimizes well enough the output given could be valid (it might construct the struct directly w

Re: Strange behavior when concatenating array

2011-06-17 Thread Steven Schveighoffer
On Fri, 17 Jun 2011 06:42:51 -0400, Steven Schveighoffer wrote: On Fri, 17 Jun 2011 00:05:56 -0400, Jose Armando Garcia wrote: It looks like the rt is not calling the postblit constructor when concatenating arrays. For example, the following code: import std.stdio; struct Test { thi

Re: Strange behavior when concatenating array

2011-06-17 Thread Steven Schveighoffer
On Fri, 17 Jun 2011 00:05:56 -0400, Jose Armando Garcia wrote: It looks like the rt is not calling the postblit constructor when concatenating arrays. For example, the following code: import std.stdio; struct Test { this(this) { writeln("copy done"); } void opAssign(Test rhs) { writel

Re: Strange behavior when concatenating array

2011-06-16 Thread Jose Armando Garcia
On Fri, Jun 17, 2011 at 1:05 AM, Jose Armando Garcia wrote: >      tests ~= test; Btw, if you replace this with 'test[0] = test;' it works as expected. The postblit ctor and the assignment operator get called and the dtor is called twice.

Strange behavior when concatenating array

2011-06-16 Thread Jose Armando Garcia
It looks like the rt is not calling the postblit constructor when concatenating arrays. For example, the following code: import std.stdio; struct Test { this(this) { writeln("copy done"); } void opAssign(Test rhs) { writeln("assignment done"); } ~this() { writeln("destructor called"); }