Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您需要指定&IInteractable::attack而不是预期成员的位置&Unit::attack。IInteractable指向被覆盖的派生类函数的指针不会转换为指向基类函数的相应指针,即使人们可能期望这样的转换是有意义的。
&IInteractable::attack
&Unit::attack
IInteractable