64,639
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
class Test {
public:
Test() {
cout<<"Test()"<<endl;
}
Test(const Test &t) {
cout<<"Test(Test)"<<endl;
}
~Test() {
cout<<"~Test()"<<endl;
}
Test &operator=(const Test &t) {
cout<<"Test(=)"<<endl;
return *this;
}
};
Test func() {
return Test();
}
int main() {
Test h = func();
return 0;
}