Is there a way to check if two instances are the same derived class? Sort of:
Base *inst1 = new A(); Base *inst2 = new B(); Base *inst3 = new A(); bool b1 = (inst1->class== inst2->class);
Obviously, I could just add a virtual function to the base class and implement each derived class to return a unique value. However, I would prefer not to do anything specific for the derived class, as I am creating an API based on this base class.
source share