I have a type Base and two identical types DerivedOne and DerivedTwo that are derived from Base.
I receive a Base * I know is a DerivedOne*.
Could I cast from DerivedOne* to DerivedTwo?
If yes how?
processMessage(Base * msg)
DerivedOne* pDerivedOne = dynamic_cast<DerivedOne *> msg;
HOW TO DO
DerivedTwo * pDeriveTwo = CAST<> pDerivedOne? Is it possible?
i don't think it's possible. while Base and Derived1 have all similar members, Derived1 and Derived2 can be very different.
Sorry for not being clear,
Derived1 and Derived2 are identical, I receive a message Base* I know is Derived1*.
Could I cast the message to Derived2?