const type qualifier in class member function
2010-12-16 11:54
441 查看
主要是解释这俩同时存在的意义:
const char* c_str() const {return m_str;};
char* c_str() {return m_str;};
解释在这里。嗷嗷的给力啊!
2011-2-1 update
在c++的设计与演化那本书里边,有讲这个问题,貌似也是为了兼容C。
改天深究。
const char* c_str() const {return m_str;};
char* c_str() {return m_str;};
解释在这里。嗷嗷的给力啊!
2011-2-1 update
在c++的设计与演化那本书里边,有讲这个问题,貌似也是为了兼容C。
改天深究。
相关文章推荐
- const type qualifier in class member function
- Request for member ‘bar’ in ‘aFoo’, which is of non-class type ‘Foo*’
- g++报错原因分析error: no......member function declared in class 'XXX‘
- const member function can return non-const type member vars
- qt 错误:request for member 'show' in 'showlist_ui', which is of non-class type 'ShowList*'
- static member variable and static member function in a class
- Element type is invalid: expected a string (for built-in components) or a class/function (for compos
- request for member 'getid’ in ‘e1’, which is of non-class type ‘Employee()’
- [C++]Partly Specialize member function in Class Templates
- ReactJs 报错 Element type is invalid: expected a string (from built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `Me`.
- error: request for member ‘***’ in ‘***’, which is of non-class type ‘***’
- error C2511 : overloaded member function not found in 'Class'
- LNK2005: __thiscall type_info::type_info(class type_info const &) already defined in LIBCMTD.lib
- error: request for member '*' in '*', which is of non-class type '*'
- Uncaught (in promise) TypeError: __webpack_require__.i(...) is not a function
- java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
- error: request for member 'FindClass' in something not a structure or union
- C++: member function pointer for SomeClass
- error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject'
- [TI DLP Buglist]data type error in illum_EnableIllumination function