C++关键字
来源:互联网 发布:c语言预处理 编辑:程序博客网 时间:2024/06/16 13:36
[图片来源: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.
- [C关键字]void 关键字
- C 关键字
- C# 关键字
- C 关键字
- C-关键字
- C 关键字
- c/c++-----static关键字
- C/C++:typedef关键字
- (C/C++)register关键字
- 【c/c++】关键字typedef
- 【C/C++】关键字static
- c/c++static关键字
- C/C++_log2000_explicit关键字
- C++-static 关键字
- C#-ref关键字
- C语言-关键字
- C 关键字 volatile
- C中volatile关键字
- debug : use _ASSERT_EXPR
- TabHost的使用
- cocos2d-x 如何管理游戏资源
- cocos2d-x基本知识点(7):动画
- Linux命令:cp 命令--创建文件和目录的副本 mv命令--移动或重命名文件/目录
- C++关键字
- Sqoop2 Intermediate representation
- Android 上传图片
- 昆仑叶哲华,你真是让我摸不着头脑
- Android高效加载大图、多图解决方案,有效避免程序OOM
- android项目 之 来电管家(3) ----- 添加与删除黑名单
- linux进程间通信的几种机制的比较及适用场合
- jquery选择器 之 获取父级元素、同级元素、子元素
- 阿里hr面面试问题