title: Check for derived type (C++)
body: <p>How do I check at runtime if an object is of type ClassA or of derived type ClassB? In one case I have to handle both instances separately</p>
  
  <pre><code>ClassA* SomeClass::doSomething ( ClassA* )
  {
      if( /* parameter is of type base class */) {
  
      } else if { /* derived class */ ) {
  
      }
  }
  </code></pre>
  
  <p>Maybe I could say that the derived class ClassB has some special capabilities. But how do I do that without changing the existing class ClassA ?</p>