I have a class Base and many Derived classes. All the Derived are identical (the same data members and functions) just the name differs Derived1, Derived2, etc.
Now the problem is that I receive a pointer to Derived1 and I should replay by sending a pointer to Derived3. Although all the Derived are the same I shoul still delete Derived1* and call new for Derived2 and deep copy all the contents from Derived1*.
Any ideas how to avoid new and deep copy and still have different names for Derived classes.
I hope I made myself understood.