ここでそれはコードで説明されています:
//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->Intersect(shapeB); //problem is here?
ポリモーフィズムを使用するそのような方法はこれまでに機能しますか、それともクラスがお互いのタイプを認識して、呼び出す適切なメソッドを知っているようにする別の方法を探す必要がありますか?