Answer from Jonathan Caves regarding “Tale of the __dtor method and the delete operator”


Thanks Jonathan!


For Whidbey we have changed the name of the destructor and constructor to {dtor} and {ctor} – this is so people cannot do the following:


class X
{
   public:
     
X(int data) : m_data(data)
      { 
      }


      ~X() 
      { 
      }


      void mf() 
      { 
      }


   private: 
      int m_data ;
} ;


int main()

      X x(1);


      x.__dtor(); 


      x.mf();


      x.__ctor(1); 
      x.__ctor(2); 
      x.__ctor(3);
}

Comments (1)

  1. Wesner Moise says:

    So, how do we call the destructor from other managed languages, where destructor calls have to be explicit.