#include<iostream>
using namespace std;
class A
{
public:
void foo()
{
cout << "A";
}
~A();
};
inline A::~A()
{
cout << "inline";
}
int main()
{
A *niu = new A();
niu ->foo();
delete niu;
return 0;
}
内联析构函数
最新推荐文章于 2021-08-19 15:19:53 发布
#include<iostream>
using namespace std;
class A
{
public:
void foo()
{
cout << "A";
}
~A();
};
inline A::~A()
{
cout << "inline";
}
int main()
{
A *niu = new A();
niu ->foo();
delete niu;
return 0;
}