C++ Programming Error/Warning Analysis (1) cannot have cv-qualifier
来源:互联网 发布:php ftp 编辑:程序博客网 时间:2024/05/18 01:35
C++ Programming Error/Warning Analysis (1) cannot have cv-qualifier
- Author:柳大·Poechant(钟超)
- Email:zhongchao.ustc#gmail.com (# -> @)
- Blog:Blog.CSDN.net/Poechant
- Date:May 9th, 2012
Explanation
不能有 CV 限定符,在 C++ 中 CV 限定符指const
和volatile
。
- 非成员函数
在 C++ 中,普通函数(非类的成员函数)不能有 CV 限定,即const
和volatile
限定。即非类的成员行数,用const
进行修饰:
int test() const //这是不对的,普通函数(非成员函数不能有CV约束){ //实现}
- 静态函数
在 C++ 中,静态成员函数(static
成员函数)不能有 CV 限定,即const
和volatile
限定。即类的静态成员函数,也不能有 CV 约束:
class Test{public: static int test_fun() const; //这个是不允许的。}
Reference
- http://blog.163.com/xychenbaihu@yeah/blog/static/132229655201149281131/
-
柳大·Poechant:Blog.CSDN.net/Poechant
-
- C++ Programming Error/Warning Analysis (1) cannot have cv-qualifier
- c++ error: cannot have cv-qualifier
- C++ error:static member function cannot have cv-qualifier
- non-member function cannot have cv-qualifier
- C++编译错误cannot have cv-qualifier
- C++编程常见错误:cannot have cv-qualifier
- C++编程常见错误:cannot have cv-qualifier等
- C++编程常见错误—cannot have cv-qualifier//不能有CV限定
- C++编程常见错误—cannot have cv-qualifier//不能有CV限定,在C++中CV指const和volatile—1、非成员函数不能有CV限定,2、静态成员函数不能有CV限定
- C++ Programming Error/Warning Analysis (2) extra qualification
- CV-qualifier
- error C2894: templates cannot be declared to have 'C' linkage
- error C2894: templates cannot be declared to have 'C' linkage
- error C2894: templates cannot be declared to have 'C' linkage
- [BCB]E2089 Identifier 'ReadPragram' cannot have a type qualifier
- error U1087: cannot have : and :: dependents for same target
- What does "Error: L6248E: cannot have address type relocation" mean?
- IAR error: a declaration cannot have a label
- HTTP POST GET 本质区别详解
- SAP IDOC 开发介绍
- DataGridView数据过长显示不全解决办法
- PPT修改母板
- brctl命令
- C++ Programming Error/Warning Analysis (1) cannot have cv-qualifier
- Apache FtpServer初次使用
- C++类型转换(Type Casting)
- 一个低级错误,目标跟踪,标记一下
- Java_代码块
- 什么才是你的不可替代性和核心竞争力
- Android发送短信的功能
- 设计模式(六)桥连模式Bridge(结构型)
- 设计模式(五)适配器模式Adapter(结构型)