title: Inheritance resolution
body: <p>I thought that types would <em>automatically</em> resolve to the <em>deepest part of the hierarchy they could</em>.   If <code>Cat : Animal</code> and you call <code>cat-&gt;talk()</code>, if <code>Cat</code> overrides a <code>talk()</code> from class <code>Animal</code>, the cat will say "meow", not some weird general <code>Animal</code> grumbling provided in base class <code>Animal</code>.</p>
  
  <p>So I'm confused about this:</p>
  
  <pre><code>struct Animal
  {
    virtual void talkTo( Animal* o ) {
      puts( "Animal-Animal" ) ;
    }
  } ;
  
  struct Cat : public Animal
  {
    virtual void talkTo( Animal* o ) {
      puts( "Cat-Animal" ) ;
    }
    virtual void talkTo( Cat* o ) {
      puts( "Cat says meow to Cat" ) ;
    }
  } ;
  </code></pre>
  
  <p>Here's some calling code:</p>
  
  <pre><code>  Cat *cat = new Cat() ;
    cat-&gt;talkTo( cat ) ; //Cat says meow to Cat
  
    Animal *animalCatPtr = cat ;      
    cat-&gt;talkTo( animalCatPtr ) ; //Cat-Animal
  </code></pre>
  
  <p>The last line here, where I send a <code>Cat</code> to <code>cat-&gt;talkTo</code>, but I'm using <code>animalCatPtr</code>.  <code>animalCatPtr</code> still refers to a <code>Cat</code>, but yet its resolving to simply an <code>Animal</code> in the function call.</p>
  
  <p>How can I make the <em>pass pointer resolve to the deepest type in the hierarchy it really is</em>?  I don't want to do a series of <code>dynamic_cast&lt;&gt;</code> testing to see if the <code>Animal</code> I have on hand is really a <code>Cat</code> or <code>Dog</code> or what have you.</p>