class ClassName
{
public:
int Fun(const int data) const
{
m_data = data;
return 1;
}
private:
mutable int m_data;
};
将非常量成员数据声明加上mutable前缀
class ClassName
{
public:
int Fun(const int data) const
{
m_data = data;
return 1;
}
private:
mutable int m_data;
};
将非常量成员数据声明加上mutable前缀