子类的虚函数调用base 类的虚函数的情况【c++ primer 】

来源:互联网 发布:中国特色帝国主义知乎 编辑:程序博客网 时间:2024/05/23 02:00

 

 

When a derived virtual calls the base-class version, it must do so explicitly using the scope operator. If the derived function neglected to do so, then the call would be resolved at run time and would be a call to itself,

resulting in an infinite recursion.

 

原创粉丝点击