Bypassing the postblit?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Dec 30 07:53:28 PST 2013


On 12/30/13 3:29 AM, Benjamin Thaut wrote:
> Am 30.12.2013 12:26, schrieb Ritu:
>>
>> Yes. That way I could make sure that the class object in the struct gets
>> lazily initialized to the same object in both the source and the copied
>> struct instance. So in the appender example you earlier gave, both app1
>> and app2 can have the same internal object.
>>
>> But then the source object may not be mutable. I am not a compiler
>> expert, but could a special case be made in D compiler for the cases
>> where the source struct instance is mutable and is made available to
>> ease such lazy initialization?
>>
>> Regards
>> - Ritu
>
>
> As I already said, the solution is another level of indirection. I had a
> similar discussion with Andrei a while back and he made clear that there
> is no intention in adding any other copy constructor / move constructor.
> Postblit will stay as is.

Walter is reconsidering that.

Andrei



More information about the Digitalmars-d mailing list