Why does double dispatch not work in C++?
<pre><code>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;

using namespace std;

class SpaceShip {};
class GiantSpaceShip : public SpaceShip {};

class Asteroid {
public:
  virtual void CollideWith(SpaceShip *) {
    cout &lt;&lt; "Asteroid hit a SpaceShip" &lt;&lt; endl;
  }
  virtual void CollideWith(GiantSpaceShip *) {
    cout &lt;&lt; "Asteroid hit a GiantSpaceShip" &lt;&lt; endl;
  }
};

class ExplodingAsteroid : public Asteroid {
public:
  virtual void CollideWith(SpaceShip *) {
    cout &lt;&lt; "ExplodingAsteroid hit a SpaceShip" &lt;&lt; endl;
  }
  virtual void CollideWith(GiantSpaceShip *) {
    cout &lt;&lt; "ExplodingAsteroid hit a GiantSpaceShip" &lt;&lt; endl;
  }
};



int main()
{
  SpaceShip * s = new GiantSpaceShip();    
  Asteroid * a = new ExplodingAsteroid();
  a-&gt;CollideWith(s);  
  getch();  

 return 0;   
}
</code></pre>

<p>How can I enable double dispatch in C++?</p>
