Bypassing the postblit?

Benjamin Thaut code at benjamin-thaut.de
Mon Dec 30 03:29:47 PST 2013


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.

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d mailing list