Destructors calling sequence

bearophile bearophileHUGS at lycos.com
Fri Nov 29 08:55:28 PST 2013


Temtaime:

> How i can enforce that ~A will be called after ~B ?
> I'm writing 3D engine and it's critical to me.

The GC doesn't give such guarantees. So you need something 
manual, or to use RAII, or scope(exit), or some other idea like 
creating an array of objects to be destroyed, etc.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list