In C++, objects can be copied by assignment or by initialisation. Copying by initialisation corresponds to creating an object and initialising its value through the copy constructor. The copy constructor has its first argument as a reference, or const reference to the object's class type. It can have more arguments, if default values are provided. Copying by assignment applies to an existing object and is performed through the assignment operator (=). The copy constructor implements this for identical type objects:
拷贝构造,是一个的对象来初始化一边内存区域,这边内存区域就是你的新对象的内存区域赋值运算,对于一个已经被初始化的对象来进行operator=操作
class A;
A a;
A b=a; //拷贝构造函数调用
//或
A b(a); //拷贝构造函数调用
///////////////////////////////////
A a;
A b;
b =a; //赋值运算符调用