Код: Выделить всё
class foo { public: char * Name() { return "foo"; }; };
class bar : public foo { public: char * Name() { return "bar"; }; };
template< typename T > struct ClassInfo { typedef T Base; };
template struct ClassInfo { typedef foo Base; };
int main()
{
ClassInfo::Base A;
ClassInfo::Base B;
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/8709340/can-the-type-of-a-base-class-be-obtained-from-a-template-type-automatically[/url]