__super
2015-12-30 17:37
253 查看
__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() { }
这样子成员函数能够调用父的成员函数
相关文章推荐
- Python 2.2 定义函数
- Linux安装VMwareTools-9.6.0-1294478.tar.gz
- 误删libgcc导致yum或rpm无法操作的解决办法
- timer
- Nginx服务器中414错误和504错误的配置解决方法
- SSAS动态添加分区
- iOS开发动画(Animation)图片360度不停旋转
- Java发邮件-QQ服务器认证(A secure connection is requiered(such as ssl))
- 矩阵填充的SVT算法
- Android开发相关的网址导航
- Oracle中的BLOB和CLOB
- js jquery学习
- 递归下降分析法
- 为 Docker Registry 增加 Nginx 前端
- 12.16_实验四 递归下降语法分析程序设计
- Matlab的学习
- GIT 学习
- cacti 监控
- 黑盒测试用例设计方法
- 如果hashCode中返回常量1,会有什么结果?