fork download
  1. import std.stdio;
  2.  
  3. class Test1
  4. {
  5. public:
  6. void hello()
  7. {
  8. writeln("hello.");
  9. }
  10.  
  11. private:
  12. }
  13.  
  14. void main()
  15. {
  16. Test1 t1;
  17. if (t1 is null) writeln("o");
  18. else writeln("x");
  19.  
  20. t1 = new Test1;
  21. if (t1 is null) writeln("o");
  22. else writeln("x");
  23.  
  24. delete t1;
  25. if (t1 is null) writeln("o");
  26. else writeln("x");
  27.  
  28. t1 = null;
  29. if (t1 is null) writeln("o");
  30. else writeln("x");
  31. }
Success #stdin #stdout 0.01s 2120KB
stdin
Standard input is empty
stdout
o
x
o
o