Good morning everyone,
to see if you remove the doubt. A constant function in theory is only used with const data members that do not modify the object, that is, this function will access a const data member but as I am looking at it, when we add mutable to a data:
class x
{
private:
mutable int miembro_datos;
}
This member can be used with const functions and can also be modified, which leads to a controversy.
Can someone help me to understand the mutable attribute? Why with mutable can you change the data of an object through a const function? In theory you should not allow your modification, no?
Thanks