fork download
  1. module main;
  2.  
  3. import std.stdio, core.memory, std.container.dlist;
  4. class hui
  5. {
  6. this()
  7. {
  8. writeln("hui()");
  9. }
  10. ~this()
  11. {
  12. writeln("~hui()");
  13. }
  14. }
  15.  
  16. void main(string[] args) {
  17. GC.disable;
  18.  
  19. auto list = new DList!int([1,2,3]);
  20. hui[10] lol;
  21.  
  22. foreach(i; 0..10)
  23. lol[i] = new hui;
  24. foreach(lolchto; lol)
  25. delete lolchto;
  26.  
  27. delete list;
  28. readln;
  29. }
  30.  
  31.  
  32.  
Success #stdin #stdout 0s 2652KB
stdin
Standard input is empty
stdout
hui()
hui()
hui()
hui()
hui()
hui()
hui()
hui()
hui()
hui()
~hui()
~hui()
~hui()
~hui()
~hui()
~hui()
~hui()
~hui()
~hui()
~hui()