Consider I have a bunch pointers to to different objects of different classes
class1* obj1;
class2* obj2;
class3* obj3;
and they all have one method getArray()
which returns a vector for post processing.
if all of these pointers are stored in some sort of a list (a list of void pointers say)
while I am iterating the list is there a way to figure what type of a pointer cast can be used?
I understand this can be solved by class hierarchy and deriving the above classes from a single class. Since a lot of it is legacy code can something like what is mentioned be done?
Folly dynamic does not let me store pointers, thats one thing that is tried