[Issue 8740] Temporary structs inside of array literals are destroyed and not copied in initialization of array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 9 02:12:47 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=8740


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2013-05-09 02:12:44 PDT ---
In 2.063a, the OP code prints following output by fixing issue 9386 (need to
mask assertions).

created: 1
created: 4
created: 5
created: 1
created: 4
created: 5
dupped: 1
dupped: 4
dupped: 5

In the first place, array literal is just created in heap, so there is no copy.
In the second place, array literal is created, and concatenation copies the
elements to the new array.

I think this is expected behavior, so mark this "RESOLVED".

*** This issue has been marked as a duplicate of issue 9386 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list