title: How do I make virtual methods of classes that inherit the same base class figure out what to do with their argument?
body: <p>Here it is explained in code:</p>
  
  <pre><code>//Sphere and Box inherit from IShape
  //
  //Sphere methods:
  //bool Sphere::Intersect(Sphere* sphere)
  //bool Sphere::Intersect(Box* box);
  //
  //Box methods:
  //bool Box::Intersect(Sphere* sphere)
  //bool Box::Intersect(Box* box)
  
  IShape* shapeA;
  IShape* shapeB;
  
  shapeA= new Sphere();
  shapeB= new Box();
  
  bool areTheyIntersecting = shapeA-&gt;Intersect(shapeB); //problem is here?
  </code></pre>
  
  <p>Will such a way of using polymorphism ever work or must I look for another way to get the classes recognize each-other's types so they know the proper method to call?</p>