const

作者: const_qiu | 来源:发表于2020-09-19 15:22 被阅读0次

this指针,不能指向常量对象,因为this是指向非常量对象的常量指针,classname * const this;
什么是常量对象,即对象的成员变量不能被改变;常量对象只能调用const 函数,常量函数的this指针被修改成了const classname * const this。

相关文章

网友评论

      本文标题:const

      本文链接:https://www.haomeiwen.com/subject/aathyktx.html