类中含有  指针类型  的成员变量时,就必须要定义 copy ctor 和 copy op=

copy ctor 请见:

class Rectangle
{
public:
Rectangle(Rectangle& rec)
: width(rec.width), height(rec.height)
{}; ~Rectangle() {}; public:
int width;
int height;
};

  

copy op= 请见:

https://www.cnblogs.com/alexYuin/p/11965172.html

04-21 20:00