Any attempt to modify a const object results in undefined behavior. This applies to const variables, members of const objects, and class members declared const. (However, a mutable member of a const object is not const.)
Such an attempt can be made through const_cast:
const int x = 123;
const_cas...