Uso Borland C++ Builder.Destructores y herencia en C++?
y tuve un problema o
#include <Classes.hpp>
class TMyObject : public TObject
{
__fastcall TMyObject();
__fastcall ~TMyObject();//I would like to inherite my destructor from TObject
};
__fastcall TMyObject::TMyObject() : TObject()//it will inherited my constructor from TObject
{
}
Y para ese nuevo destructor que inherite ~TObject
?
__fastcall TMyObject::~TMyObject?????????????
'TObject' es una clase de sistema proporcionada por Borland, y tiene un destructor virtual. –
Ok! Por lo tanto, no debería haber ningún problema aquí: ~ Deberían llamarse TMyObject() y ~ TObject() sin nosotros para hacer algo específico. – Shlublu
Correcto, y funciona así como se esperaba. –