I've got the following classes:
class Father {
//some code
}
class child1: public Father {
//some code
}
class childN: public Father {
//some code
}
I've got two list of Father references. I need to check if one instance of a list is present in the other list. I need to do a "deep" check (not a pointer comparison). I can do it doing a dynamic_cast
and then comparing the objects, but I'm wondering if there is some smart approach or pattern.
Edit: The Father class is a generic class and an unique identifier can be of some meaning only for some child classes.