29
23
u/stupled 2d ago
Reinterpreter cast 🤔
6
7
u/GegeAkutamiOfficial 1d ago
const_castI think, I believereinterpreter_castfails a mutable conversion
9
u/Vesuvius079 2d ago
This is just as fucked up as being stuck on a deserted island with only a volleyball to keep you company.
Well done.
3
u/creeper6530 1d ago
AKA, how to fuck up everyone's expectations, the compiler's optimisations, and any sanity you'll retain after debugging this.
39
u/WhiteEvilBro 2d ago
That's one thing i didn't quite understand about C++, why would I ever want to un-const my pointer? If I know that I need to write there, I won't make it const, and if I have const pointer, it could be impossible to write by that memory address?
What's the usecase of const_cast?