C++含有指针成员的类# Programming - 葵花宝典
y*b
1 楼
通常destructor删除这个指针以释放内存。
但是现在这个指针指向的是一个forward declared的类,结果gcc提示:
neither the destructor nor the class-specific operator delete will be called
, even if they are declared when the class is defined
就是说这种情况无法释放内存?不仅如此,连行为都undefined?
但是现在这个指针指向的是一个forward declared的类,结果gcc提示:
neither the destructor nor the class-specific operator delete will be called
, even if they are declared when the class is defined
就是说这种情况无法释放内存?不仅如此,连行为都undefined?