Destructor called while object is still alive

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Fri Oct 23 16:33:49 UTC 2020


On Friday, 23 October 2020 at 16:27:53 UTC, Kagamin wrote:
> Your C++ glasses are too thick, the snippet uses reference 
> type, there's no RAII there.

"Resource acquisition is initialization" is typically done with 
reference types. Doesn't matter whether you name them "struct" or 
"class". So what? It is a completely bogus argument. Since D now 
has a precise GC you should get reliable destruction if you avoid 
unions.



More information about the Digitalmars-d mailing list