Do I have to call a parent class extinction?

Asked 2 years ago, Updated 2 years ago, 106 views

C++ class is overriding the virtual extinction Should I call a parent class extinction within the extinction?

MyChildClass::~MyChildClass()
{
    //Call Parent Class Destructor
    this->MyBaseClass::~MyBaseClass();

    Clean up the values in MyChildClass
}

c++ destructor

2022-09-22 22:30

1 Answers

No, don't do that. You did a great job setting it to virtual The destructor is called in the opposite order to the order in which it was generated automatically.


2022-09-22 22:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.