Suppose I have the following classes:
class BaseObject { public: virtual int getSomeCommonProperty(); }; class Object1: public BaseObject { publ
I think you should go for option 1 but use a static cast instead. After all the derived collection knows the type of the member variable for sure.
This answer explains it very well.