#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
class Object
{
public:
int a;
Object() : a(0)
{
printf("construct\n");
}
Object(const Object& _object) : a(_object.a)
{
printf("copy construct\n");
}
~Object()
{
printf("delete\n");
}
};
Object fun()
{
Object o;
return o;
}
int main()
{
Object o = fun();
return 0;
}
construct
copy construct
delete
delete
拷贝构造函数只执行了一次