根据昨天提出的问题,我写了一个简单的测试代码:
class A
{
public:
A(int)
{
cout<<"constructor\n";
}
A(const A&)
{
cout<<"copy constructor\n";
}
};
int main()
{
A(0);
cout<<"------------------------\n";
A(A(0));
cout<<"------------------------\n";
A(A(A(0)));
cout<<"------------------------\n";
A(A(A(A(0))));
cout<<"------------------------\n";
A(A(A(A(A(0)))));
cout<<"------------------------\n";
return 0;
}
输出:
constructor
------------------------
constructor
------------------------
constructor
copy constructor
------------------------
constructor
copy constructor
------------------------
constructor
copy constructor
copy constructor
------------------------
因此,如果发明人打电话或类型演员发生时明确表示非常奇怪,是否有人可以尝试解释这一点?