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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 1 11:48:33 PDT 2012


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



--- Comment #3 from Maxim Fomin <maxim at maxim-fomin.ru> 2012-11-01 11:48:32 PDT ---
(In reply to comment #2)
> I mean:
> //----void main()
> {
>     S[2] a = [S(1), S(2)];
>     S[2] b = a; //Fine postblit here
>     a[] = b[];  //But HERE, please use opAssign.
> }
> //----

I see now and it does make sense. But it seems to be impossible now because of
how _d_arrayassign function
(https://github.com/D-Programming-Language/druntime/blob/master/src/rt/arrayassign.d#L30)
assigns arrays: it uses memcpy+postblit+destroy because TypeInfo class
(https://github.com/D-Programming-Language/druntime/blob/master/src/object.di#L68)
lacks entry related to opAssign method.

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