const 成员函数、mutable 与逻辑常量性 | C++
本章覆盖:const member function;`this` 的 const 限定;const overload;`mutable`;cache / lazy computation 场景;logical constness;不能在 const 成员函数随意修改对象状态;mutable 不应成为逃避设计的工具;线程安全缓存仍需要同步。
本章知识点
- const member function
this的 const 限定- const overload
mutable- cache / lazy computation 场景
- logical constness
- 不能在 const 成员函数随意修改对象状态
- mutable 不应成为逃避设计的工具
- 线程安全缓存仍需要同步