
3 May
2008
3 May
'08
8:22 p.m.
AMDG Stefan Seefeld wrote:
#include <iostream>
struct Base { ~Base() { std::cout << "~Base" << std::endl;} };
struct Derived : Base { ~Derived() { std::cout << "~Derived" << std::endl;} };
void destruct(Base *b) { delete b;}
int main(int, char **) { Derived *derived = new Derived; destruct(derived); }
Run the above code as is, and with the base destructor made virtual, to see the difference.
That's true, but AFAICT, completely irrelevant in this case. In Christ, Steven Watanabe