虚拟是否在C ++中定义了智能函数指针?

问题描述

在我的理解中,在派生类之间进行切换时,虚拟有点像samrt函数指针。与“真实功能”相比,有什么更好的理解来说明“虚拟”?

解决方法

您所说的samrt funtion pointerDynamic dispatchhttps://en.wikipedia.org/wiki/Dynamic_dispatch)。实现Dynamic dispatch的典型方法称为vurtual method tablehttps://en.wikipedia.org/wiki/Virtual_method_table