Mutable

This lets you modify a class member variable inside a const member function or on a const object
const method asks compiler that it will not change any part of the object. If we mark a variable as mutable, we tell the compiler that this specific data member can be changed inside const function/object

#include <iostream>
#include <string>
using namespace std;

class A {
private:
    int var;          

public:
    A(int v) : var(v) {}

    void fun() const {
        var++;            <<<< member variable cannot change inside mutable function
    }
};

int main() {
    const A ObjA(0);
    
    ObjA.fun();
    return 0;
}
$ g++ test.cpp
error: increment of member 'A::var' in read-only object
Mutable variable can be changed inside const Function
#include <iostream>
#include <string>
using namespace std;

class A {
private:
    mutable int var;    <<<< Mutable can be changed inside const function

public:
    A(int v) : var(v) {}

    void fun() const {   // A const member function
        var++;
    }
};

int main() {
    const A ObjA(0);
    
    ObjA.fun();
    return 0;
}