Answers for "assign value to a const cpp"

C++
0

update variable in const function C++

//declare x mutable
class A (){
   mutable int x;
public:
   void func () const {
      //change value of x here
   }
};
Posted by: Guest on August-03-2021

Code answers related to "assign value to a const cpp"

Browse Popular Code Answers by Language