摘要: 1.常量成员函数 1.1把this指针的类型变为const type *const this 1.2常量成员函数内部不能修改其成员,但这只是语法层面的限制 void foo() const { //this->p = nullptr;//编译报错 HasPtr *ptr = (HasPtr*)thi 阅读全文
posted @ 2020-05-13 20:59 八转达人 阅读(209) 评论(0) 推荐(0)