class X;
class Y {
public:
~Y();
private:
map<int,X*> m;
vector<X*> v;
X* px;
};
我猜析构函数class Y
应该是这样的?
Y::~Y() {
delete px;
for (vector<X*>::iterator it = v.begin(); it!=v.end(); it++)
delete *it;
v.clear();
}
但是呢Y::m
?