template <typename T>
T* func(); // Does things
MyClass* c = new MyDerivedClass();
My question is: How can I pass to func<>() 'MyDerivedClass' as template parameter (note: in this case it's 'MyDerivedClass' but it could be any derived class, so the method needs to be dynamic)?
Well, I should do that for every derived, class... I was looking for something dynamic.
I have this class method and I have to call it from a derived class, not an external one... I have just to pass its class back to the parent method to call it...
If for template < typename T > T* func() ; type T must be a class derived from base
and it would be acceptable to change the result type of the function to base*
ie. template < typename T > base* func() ;