__super
来源:互联网 发布:网站流量统计软件 编辑:程序博客网 时间:2024/05/23 16:50
__super::member_function();
The __super keyword allows you to explicitly state that you are calling a base-class implementation for a function that you are overriding. All accessible base-class methods are considered during the overload resolution phase, and the function that provides the best match is the one that is called.
struct B1 { void mf(int) { // ... }};struct B2 { void mf(short) { // ... } void mf(char) { // ... }};struct D : B1, B2 { void mf(short) { __super::mf(1); // Calls B1::mf(int) __super::mf('s'); // Calls B2::mf(char) }};int main() {}
这样子成员函数可以调用父的成员函数而不需要写父类名称,这是vs编译器特有的,gcc是不支持的。
1 0
- __super
- __super
- __super
- __super
- __super
- C++ __super
- __super 关键字
- VC2005代码关键字__super
- __super in MFC
- __super in MFC
- __super的作用
- VC中的__super关键字
- vc中__super的用法
- 51.VC(Custom)-__super简介
- 51.VC(Custom)-__super简介
- VC 编译器的C++关键字 __super
- __super关键词 显式调用基类虚函数
- 黑马程序员——Java基础---接口和多态
- 小胖说事12--------iOS App集成Apple Pay教程(附示例代码)
- 进程和线程的联系和区别 ,抽象类与接口的区别
- 用Struts2写的第一个"Hello,World!"
- PHP中定义数组的三种方式
- __super
- POJ 1364-King(差分约束系统)
- Android语音播报、后台播报、语音识别
- LightningChart Ultimate使用教程:使用SampleDataSeries进行实时监测
- socket编程整理
- JSON数据解析(GSON方式)
- 如何衡量软件设计的质量
- html页面上传图片并进行展示
- 开始使用Nim(二)