std::dynamic_pointer_cast Error: source type is not polymorphic

std::dynamic_pointer_cast encountered an error source type is not polymorphic

The reason is that the type to be converted is not polymorphic, that is, there is no virtual function

Simply define the destructor of the base class as a base class

virtual ~A() = default;

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *