我有一個類層次結構的三個層次深,像這樣: class A {
public:
virtual ~A() {}
}
class B : public A {
public:
virtual ~B() {}
void foo(E *e) {
e->remove(this);
}
}
class C : public B {
pub
我有三個類。 class Son : public Father;
class Father : public Grandfather;
Father是抽象的,所以是Grandfather。 Son不是抽象的。 如果我這樣做: Son* son = new Son();
,然後做到這一點: delete(son)
我如何確保的Father和Grandfather的析構函數叫什麼名字
我有以下代碼 #include <vector>
#include <iostream>
class A{
private:
std::vector<int> x;
A(){
// here is a code to open and initialize several devices
// it is allowed to be ca