struct postblit not called, but still destructed

Maxim Fomin maxim at maxim-fomin.ru
Mon Jan 20 00:46:34 PST 2014


On Sunday, 19 January 2014 at 20:46:06 UTC, monarch_dodra wrote:
>
> I think the behavior is not *strictly* incorrect: When you 
> write:
> sup = a;
>
> it triggers a postblit of "a" into "sup". To do said postblit, 
> you destroy sup. It's the way it works :/
>
> Arguably, since it is initialization, we could avoid the 
> destruction altogether, but it's not strictly *wrong*.
>
> I'll file it as an ER, and try to get Kenji on it.

It is rather bug than ER because recently there was work to 
recognize such cases (initial assignment in constructors) as 
initialization, not just assignment. However I am not sure here 
because these changes were not documented properly.


More information about the Digitalmars-d-learn mailing list