clear() causes crash?

"Luís "Luís
Mon Apr 29 14:04:29 PDT 2013


This crashes in the last line of main:

     class A
     {
         void foo() {}
     }

     void main()
     {
         A a = new A();
         a.foo();
         clear(a);
         assert(a !is null);
         a.foo();  // crashes
     }

As far as I understand from TDPL book, this should not crash, but 
it does (DMD64 v2.062, OS X). Am I misunderstanding clear()?

BTW, why not make clear also change 'a' to null?


More information about the Digitalmars-d mailing list