Wpis z mikrobloga

@Arkadio88: Pewnie nic złego się nie stanie i kompilator sobie z tym poradzi, ale jednak według standardu to jest UB:

Depending on the type of the object, a write operation through the pointer, lvalue or pointer to data member resulting from a const­cast that casts away a const-qualifier may produce undefined behavior


Natomiast nie zachęcajmy do constcasta, zachęcajmy do dobrych praktyk czyli wspokniany operator nie powinien modyfikować obiektu, lepiej mieć