A
away
1. When a class defined with a member of pointer type, it's necessary to
have a copy constructor and assignment operator.
If don't pass objects of such class as value in a function and don't do
assignment, should copy constructor and assignment operator be unnecessary?
2. If a base class have a pointer member, should its derived classes also
need copy constructor and assignment operator, no matter if a derived class
itself has a pointer member or not?
3. If such a pointer member of pointer type of "void", such void type can be
casted to any other type at runtime, how to code a copy constructor for such
a member?
Thanks for help!
have a copy constructor and assignment operator.
If don't pass objects of such class as value in a function and don't do
assignment, should copy constructor and assignment operator be unnecessary?
2. If a base class have a pointer member, should its derived classes also
need copy constructor and assignment operator, no matter if a derived class
itself has a pointer member or not?
3. If such a pointer member of pointer type of "void", such void type can be
casted to any other type at runtime, how to code a copy constructor for such
a member?
Thanks for help!