按照题库敲的,一模一样,怎么提示说析构函数声明无效呢🤔

#include
using namespace std;
class TV {
public:
TV(int s= 41): size(s) { }
void print(){cout<<'/' << 'N'<< size; }
void print() const { cout <<'/' << 'C' << size; }
void print(int s){cout <<'/' << 'S' << size; }
private:
int size;
~MyBag() { --count; }
static int GetCount(){ return count; }
private:
string brand, color;
static int count;
};
int main() {
MyBag one("CityLife", " Gray"), two("Micky" " Red");
cout << MyBag::GetCount();
return 0;
}

析构函数一般不设置成私有。如果析构函数设置成私有,不能在栈上创建对象。可以动态创建对象。可以使用友元函数来显示销毁动态创建的对象