Say you have the following hierarchy. You have an Animal base class, with a bunch of subclasses like Cat, Mouse, Dog, etc.
Now we have the following scenario:
void ftn() { throw Dog(); } int main() { try { ftn(); } catch(Dog &d) {
So, I want that, even if the dog was cast, I want the scene "Dog caught" to be performed, as well as the case of "Capture animals" to perform. How do you do this?
source share