The keyword mutable before the data field allows you to modify the value of this field, even if it is in a constant object.
The keyword static does not fit, because in this case it is necessary to define A::field outside the class so that the linker knows the memory address at which the value of A::field is stored.
Login in to like
Login in to comment