访问重写的基本方法/函数 [英] Accessing overridden base methods/functions

查看:60
本文介绍了访问重写的基本方法/函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


给出以下示例:

Hi!

Given the following example:

展开 | 选择 | Wrap | 行号

推荐答案

你在公开之后忘记了冒号,但是,不,没有理由不应该调用基础dosome。
You forgot a colon after public, but, no, there is no reason why the base dosomething shouldn''t be called.


谢谢你的快速回复,Darryl !


你知道任何情况会使Base :: doSomething在被覆盖时不可见,即使它不是虚拟函数吗?


我是从预编译对象派生而来,以下示例的工作方式是e xpected:

Thank you for your swift reply, Darryl!

Do you know of any case that would make Base::doSomething invisible when overridden even though it is not a virtual func?

I am deriving from a precompiled object and the following example works as expected:

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


我想这取决于你如何访问它。例如:

I guess it depends on how you are accessing it. For example:

展开 | 选择 | Wrap | 行号


这篇关于访问重写的基本方法/函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆