Hi!
the title probably is misleading, but i didn't really know how to name it.
let's say I have the following structs
template <typename T>
struct SillyBase{
void doFunnyStuff(vector<T> vec){
dummyField = T();
for(int i=0; i<10; i++)
vec.push_back(dummyField++);
}
T dummyField;
};
struct A : public SillyBase<char>{};
struct B : public SillyBase<float>{};
now let's further assume i have a pointer
ISillyBase* ptr;
which is pointing to an object of a DECENDANT class (A or B) of SillyBase - however, i DON'T KNOW which one (i just know it's either A or B);
Is there ANY way for me to call doFunnyStuff() ?
maybe something like:
vector<dynamic_generic_type_of(ptr)> vec;
ptr->doFunnyStuff(vec);
thanks!