I have a template function which takes in objects. I need to determine whether the object is derived from a particular base class. If it is derived from the base class, I need to call additional function. Is there anyway I could do it in C++ Linux?
class baseA{
};
class derivedA:baseA{
};
class testB{
};
template<typename T>
void functionA(const T& value){
//if T is derived from baseA, call an additional function
//perform common operations for derivedA and testB...
}
To clarify, the additional function is a member function in derivedA but not in testB.