One of the situations when you should use dynamic_cast , even if you know that the dynamic type is when cast & shy: is from a virtual database to a more derived type:
struct A { }; struct B : virtual A { }; struct C : virtual A { }; struct D : B, C { }; A * p = new D; D * q = dynamic_cast<D*>(p);
The reason, of course, is that the virtual database is determined only at runtime.
Another use of dynamic_cast is to discover the address of the most derived cast object to void* , although it is not entirely clear if this is necessary. (I managed to con & shy; use a use case , but mostly it's academic.)
source share