How about this:make these classes inherit from an intermediate base class, Base2, which itself inherits from the original Base. This way, you can achieve the same effect by checking whether Base* p can be converted to Base2*.This also aligns with the concept of inheritance, as these classes do share specific common traits.