问题描述
在我的理解中,在派生类之间进行切换时,虚拟有点像samrt函数指针。与“真实功能”相比,有什么更好的理解来说明“虚拟”?
解决方法
您所说的samrt funtion pointer
是Dynamic dispatch
(https://en.wikipedia.org/wiki/Dynamic_dispatch)。实现Dynamic dispatch
的典型方法称为vurtual method table
(https://en.wikipedia.org/wiki/Virtual_method_table)