Answers for "assigning a variable to const reference c++"

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 "assigning a variable to const reference c++"

Browse Popular Code Answers by Language