Checking whether a cross-cast could possibly work?
I know that it's legal to use dynamic_cast to do a "cross-cast" across a class hierarchy. For example, if I have classes that look like this: A B \ / C If I have an A* pointer that's pointing at an object of type C , then I can use A* aPtr = /* ... something that produces a C* ... */ B* bPtr = dynamic_cast<B*>(aPtr); to get a pointer to the B base object of the C I'm pointing at. The reason I mention this is that at the time that I write the above code, it's possible that the compiler has not yet seen the definition of C even though it's seen A and B . This means that it's possible that the