[Issue 8931] array/slice assignment causes destruction + postblit instead of opAssign

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 1 10:57:56 PDT 2012


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


Maxim Fomin <maxim at maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim at maxim-fomin.ru


--- Comment #1 from Maxim Fomin <maxim at maxim-fomin.ru> 2012-11-01 10:57:55 PDT ---
I don't understand clearly this issue. You first state that when arrays are
assigned you expect that this is done element-by element, but actually all
elements of an array are firstly destroyed and then replaced.

However output shows just the opposite: assignment is done element-by-element.
Differences between two versions of main() are in the fact that elements of
fixed arrays are constructed (because fixed arrays are of value semantic) and
in order of assignment: in fixed array case elements are copied from the
beginning and in case of dynamic arrays the operation starts from the last
element. None of versions calls opAssign. I don't understand how your
conclusion is based on code and what you are trying to say.

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