title: Identifying derived class from base class
body: <p>Is there any way to check if two instances are the same derived class? Something like:</p>
  
  <pre><code>Base *inst1 = new A();
  Base *inst2 = new B();
  Base *inst3 = new A();
  
  
  bool b1 =  (inst1-&gt;class== inst2-&gt;class); //&lt;-- should evaluate to false
  bool b1 =  (inst2-&gt;class== inst3-&gt;class); //&lt;-- should evaluate to true
  </code></pre>
  
  <p>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 having to implement anything specific for the derived class as I am making an API based around deriving from this base class. </p>