This is a blog for interview questions. The questions are primarily from certain web forums, BBS or books. The owner of this blog doesn't claim any copyright of those questions. The blog is established primarily to help the blog owner prepare job interviews.
Monday, June 27, 2011
"Mutable" Key Word
mutable allows a class data member to be modified in a const function.
Example:
Class A{
private:
mutable int x;
public:
void foo(int a) const
{
x = a;
}
}
No comments:
Post a Comment