//declare x mutable class A (){ mutable int x; public: void func () const { //change value of x here } };