最初由 西出阳关 发布
C++ uses the default copy constructor only if there is no copy constructor defined for the class. Given that, you have to put sth in {...} because C++ doesn't use the default copy any more in your case.
BTW, the default copy constructor only makes a shallow copy. Don't write a copy constructor if shallow copies are ok for you. In addition, if you need deep copy, you have to write your own copy constructor.
Good luck!