写出下列程序的运行结果(备注:函数返回值按照优化后不生成临时对象完成)
#include<iostream>
using namespace std;
class Test
{
private:
int x;
public:
Test(int x)
{
this->x = x;
cout << x <<" parameter constructed" << endl;}
Test()
{
x = 0;
cout << x <<" default constructed" << endl;
}
Test(Test& t)
{
x = 0;
cout << x <<" copy constructed" << endl;
}
Test(const Test& t)
{
x = 1;
cout << x <<" const copy constructed" << endl;
}
void init(int x)
{
this->x = x;
cout << x <<" init constructed" << endl;
}
~Test()
{
cout << x <<" destroied" << endl;
}
int GetX()