Why would an initialised struct pointer field be null in the struct's destructor?

Gary Willoughby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 20 06:25:31 PDT 2017


On Saturday, 20 May 2017 at 11:15:57 UTC, Moritz Maxeiner wrote:
> Because `element = tmp` destroys `element`, which you allocated 
> filled with zeroes.
> The destructor will run for each `element`.

Right, I get it because the destructors running on the struct 
that is being replaced. Doh!


More information about the Digitalmars-d-learn mailing list