Hello
Suppose I have some templated function. Is it possible to figure out which type the template is? For instance:
In case it is, is this a bad programming approach?Code:template <typename T> T * some_function() { if (typeid(T) == someobject_type) return ...; return 0; }
I want to have one function for all object types that derive from some base class instead of having separated function for each (function returns pointer to derived class).