📅  最后修改于: 2022-03-11 14:44:49.425000             🧑  作者: Mango
//SHALLOW COPY
class X
{
private:
int i;
int *pi;
public:
X()
: pi(new int)
{ }
X(const X& copy) // <-- copy ctor
: i(copy.i), pi(copy.pi)
{ }
};