明明没有调用复制构造函数。编译运行以下测试程序:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include
#include
using namespace std;
class A{
public:
A(){cout<<"A::A()"<
int main()
{
A a,b;
a=b;
system("pause");
return 0;
}
结果是(在Dev-Cpp 4.9.9.2上编译的结果):
A::A()
A::A()
operator=(A&)
证明没有调用A::A(A&)