Destructors calling sequence

Ali Çehreli acehreli at yahoo.com
Fri Nov 29 09:08:18 PST 2013


On 11/29/2013 08:58 AM, Adam D. Ruppe wrote:

 > In this specific case, you can force a collection at the end of main()
 >
 >
 > void main() {
 >      auto b = new B;
 >      a = new A;
 >
 >      import core.memory;
 >      GC.collect();
 > }

Note that the OP requires the unusualy destruction order: b first.

In any case, these objects can be destroyed without destroy anyway.

     mixin("dest" ~ /* :p */ "roy(a);");

Ali



More information about the Digitalmars-d-learn mailing list