RCArray is unsafe

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 2 16:04:09 PST 2015


On 3/2/15 4:01 PM, Zach the Mystic wrote:
> On Monday, 2 March 2015 at 22:58:19 UTC, Walter Bright wrote:
>> His insight was that the deletion of the payload occurred before the
>> end of the lifetime of the RC object, and that this was the source of
>> the problem. If the deletion of the payload occurs during the
>> destructor call, rather than the postblit,
>
> RcArray, a struct, already does this. You wouldn't delete in a postblit
> anyway would you?

Deletion occurs in opAssign.

> Do you need opRelease and ~this to be separate for
> structs too?

Probably not.


Andrei


More information about the Digitalmars-d mailing list