In one class A I have a vector which stores elements of type let's say Device so I have a member like
vector <Device*>* pDeviceCollection;
In another class B which extends A and it's a template with DeviceType parameter I would like to have a member like
vector <DeviceType*>* pDeviceConcreteCollection
in order to manage the vector with the template parameter but without coping the previous vector in the class A.
My question is if there's any kind of wrapper that let me use the vector from
the class A in the class B without doing the cast by myself. Something like I only have to specify when I create the wrapper that the return object should be of type DeviceType and everytime I access to the vector it returns a object of type DeviceType