this指针,不能指向常量对象,因为this是指向非常量对象的常量指针,classname * const this;
什么是常量对象,即对象的成员变量不能被改变;常量对象只能调用const 函数,常量函数的this指针被修改成了const classname * const this。
this指针,不能指向常量对象,因为this是指向非常量对象的常量指针,classname * const this;
什么是常量对象,即对象的成员变量不能被改变;常量对象只能调用const 函数,常量函数的this指针被修改成了const classname * const this。
本文标题:const
本文链接:https://www.haomeiwen.com/subject/aathyktx.html
网友评论