[Compiler]Enable Run-Time Type Information

Without knowing what your code is trying to do or why, a simple and easy solution to this would be to create an enum with a value mapping to each of your class types. Then, add a virtual function to your base class that’s something like GetClassType. Then, in each of the child classes, have them implement that function and return their corresponding enum.

You could also accomplish this without the enum by using individual functions i.e IsClassA(), IsClassB(), etc. This can make your code messy very quickly, but it’s also more flexible. For instance, you could support ClassC which is a child of ClassB which is a child of ClassA, and you would be able to call IsClassA(), IsClassB(), and IsClassC() and they would all return true.