Hi,
I need help about copy constructor
Compiler just gave warning about using private data member of rhs;Code:class A { public: ... A(const A& rhs) {_n1 = rhs._n1; _n2 = rhs._n2;} private: int _n1; int _n2; }
I know that it doesn't need to explicit declare copy constructor in this case.
But what if I want to declare it explicitly, how should I do? Removing the private access label seems not a good idea for me.
Thx for reply