析构函数可以是内联函数吗?
析构函数可以是内联函数吗?书上说是的,还举例了,可是我按他写的出现了错误,大家看看该怎么改?#include<iostream>
using namespace std;
class A
{
public:
void foo()
{cout<<"A"<<endl;}
~A();
}
inline A::~A()
{cout<<"inline";}
int main()
{
A *p=new A();
p->foo();
delete p;
return 0;
}