> typeid is pointing to a base class right? that swhy it always returns the bse class id?
Yes. To get the dynamic type of the pointed-to object, de-reference the pointer: for( auto ptr : texts ) if( ptr != nullptr ) std::cout << typeid(*ptr).name() << '\n' ;