博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C++ 名字冲突和继承
阅读量:4087 次
发布时间:2019-05-25

本文共 480 字,大约阅读时间需要 1 分钟。

15.5.2. Name Collisions and Inheritance

Note:A  derived-class member with the same name as a member of the base class hides direct access to the base-class member.

 

Using the Scope Operator to AccessHidden Members

 

We can access a hidden base-class member by using the scope operator:

structDerived : Base {

intget_base_mem() { return Base::mem; }

};

 

Best Practices:When designing a derived class, it is best to avoid name collisions with members of the base class whenever possible.

转载地址:http://ayyii.baihongyu.com/

你可能感兴趣的文章
Java并发编程 | 一不小心就死锁了,怎么办?
查看>>
Openldap开启TLS
查看>>
Openldap集成Kerberos
查看>>
Ranger集成Kerberos
查看>>
solr集成kerberos认证
查看>>
Flink安装部署
查看>>
Hadoop — MapReduce原理解析
查看>>
elasticSearch安装部署
查看>>
elasticSearch基本使用
查看>>
HBase读写的几种方式(一)java篇
查看>>
Jetson Nano安装pytorch 基于torch1.6和torchvision0.7
查看>>
【Jetson-Nano】2.Tensorflow和Pytorch的安装
查看>>
ubuntu 系统下的Caffe环境搭建
查看>>
Yolov5系列AI常见数据集(1)车辆,行人,自动驾驶,人脸,烟雾
查看>>
【Jetson-Nano】2.Tensorflow object API和Pytorch的安装
查看>>
荔枝派 Nano 全志 F1C100s 编译运行 Linux ubuntu并升级gcc
查看>>
C++ STL 四种智能指针
查看>>
基于sympy的python实现三层BP神经网络算法
查看>>
玩玩机器学习1——ubuntu16.04 64位安装TensorFlow GPU+python3+cuda8.0+cudnn8.0
查看>>
CentOS7 搭建Pulsar 消息队列环境,CentOS(Linux)部署Pulsar,亲测成功,以及Python操作Pulsar实例驱动
查看>>