dynamic_cast后有括号
void doSomething(Movable *obj)
{
obj->move();
if(typeid(*obj) == typeid(Bus))
{
Bus *bus = dynamic_cast<Bus*>(obj);
bus->carry();
}
if(typeid(*obj) == typeid(Tank))
{
Tank *tank = dynamic_cast<Tank*>(obj);
tank->fire();
}
}