mutable的用法

来源:互联网 发布:phpmyadmin默认端口 编辑:程序博客网 时间:2024/05/16 04:36

这个修饰词只用在类的非静态和非const成员变量,如果变量声明为mutable,则如果成员函数是const的,也可以修改这个值。

(This keyword can only be applied to non-static and non-const data members of a class. If a data member is declared mutable, then it is legal to assign a value to this data member from a const member function.  )

原创粉丝点击