Copying a virtual baseclass
Posted on 2007-11-25
I have something like this:
Later in my app, I want to make a copy of that object. What's the right way to do it?
BaseType* pCopy = new BaseType(Stuff);
I'm not quite sure what will happen because Stuff is now represented as a base type even though it was allocated as a derived type. I want to allocate a copy of it as a base type to interact with it via it's base class interface.