拷贝赋值运算符是由编译器自动实现,除非你提供一个。
A copy assignment operator is implemented by the compiler automatically unless you provide one.
每个类(其实例要在容器内使用)必须至少实现拷贝构造函数(实现赋值运算符,也是好习惯)。
Each class whose instance will go into the container must implement at least the copy constructor it is good to implement also the assignment operator.
放在单独的功能调用析构函数和拷贝构造函数和赋值运算符你所需要的功能。
Put the functionality you need in separate functions called by the destructor and the copy constructor and the assignment operator.
应用推荐