当前位置: 首页 > news >正文

C++关键字

[图片来源:cppreference]

1、const/volatile

The const (and volatile) qualifier binds to the left. This means that any time you see const, it is being applied to the token to the left of it. There is one exception, however; if there's nothing to the left of the const, it binds to the right, instead. It's important to remember these rules.

Another blog about const

Another blog about volatile


2、explicit

You have a MyString(int size) class with a constructor that constructs a string of the given size. You have a function print(const MyString&), and you call it with print(3). You expect it to print "3", but it prints an empty string of length 3 instead.


3、virtual

http://www.stroustrup.com/bs_faq2.html


4、mutable

 A mutable member in Class can be modified in const member function.


5、override/final

Another blog




Working……  To be detailed.


相关文章:

  • Open Broadcaster Software源码阅读笔记
  • 简单算法--迭代/递归
  • 背包九讲笔记
  • 关于类成员函数中静态变量的一点提示
  • C++ 强制类型转换若干问题
  • 面向对象设计原则
  • C++之父FAQ阅读笔记
  • 要完成的学习或考试任务
  • 类的const、static、const static成员初始化位置及其他需要注意的问题
  • ldd
  • 智能指针
  • 常用开发工具快捷键--Visual Studio 2010+Visual C++ 6.0
  • Qt Creator 常用快捷键
  • C++ 运算符优先级表
  • Snailevil's Qt List
  • 深入了解以太坊
  • [NodeJS] 关于Buffer
  • 【140天】尚学堂高淇Java300集视频精华笔记(86-87)
  • 【159天】尚学堂高琪Java300集视频精华笔记(128)
  • 【css3】浏览器内核及其兼容性
  • 【剑指offer】让抽象问题具体化
  • Android组件 - 收藏集 - 掘金
  • Angular6错误 Service: No provider for Renderer2
  • css布局,左右固定中间自适应实现
  • fetch 从初识到应用
  • flask接收请求并推入栈
  • Hibernate【inverse和cascade属性】知识要点
  • HTTP中GET与POST的区别 99%的错误认识
  • Linux中的硬链接与软链接
  • Map集合、散列表、红黑树介绍
  • Median of Two Sorted Arrays
  • Otto开发初探——微服务依赖管理新利器
  • Promise初体验
  • quasar-framework cnodejs社区
  • vue+element后台管理系统,从后端获取路由表,并正常渲染
  • webpack+react项目初体验——记录我的webpack环境配置
  • 创建一个Struts2项目maven 方式
  • 开源SQL-on-Hadoop系统一览
  • 两列自适应布局方案整理
  • 如何用vue打造一个移动端音乐播放器
  • 使用前端开发工具包WijmoJS - 创建自定义DropDownTree控件(包含源代码)
  • 通信类
  • 温故知新之javascript面向对象
  • 无服务器化是企业 IT 架构的未来吗?
  • 小程序滚动组件,左边导航栏与右边内容联动效果实现
  • 你学不懂C语言,是因为不懂编写C程序的7个步骤 ...
  • ​linux启动进程的方式
  • #{}和${}的区别是什么 -- java面试
  • #if和#ifdef区别
  • #pragma data_seg 共享数据区(转)
  • #我与Java虚拟机的故事#连载06:收获颇多的经典之作
  • (12)Linux 常见的三种进程状态
  • (层次遍历)104. 二叉树的最大深度
  • (二)Eureka服务搭建,服务注册,服务发现
  • (二)Linux——Linux常用指令