what to do with postblit on the heap?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Jun 21 14:25:25 PDT 2011


On 6/21/11 4:24 PM, Sean Kelly wrote:
> On Jun 21, 2011, at 11:26 AM, Andrei Alexandrescu wrote:
>>
>> The rule that move and TDPL rely on but is not fully implemented is that returning a nonstatic local value never does a postblit nor a destructor - it just copies the bits.
>
> So it's effectively illegal to have a struct containing a pointer that references itself, correct?

Illegal. All D structs must be transparently relocatable without 
breaking their invariant.

Andrei


More information about the Digitalmars-d mailing list