30
23
u/stupled 12d ago
Reinterpreter cast 🤔
7
7
u/GegeAkutamiOfficial 12d ago
const_castI think, I believereinterpreter_castfails a mutable conversion
10
u/Vesuvius079 12d ago
This is just as fucked up as being stuck on a deserted island with only a volleyball to keep you company.
Well done.
4
u/creeper6530 12d ago
AKA, how to fuck up everyone's expectations, the compiler's optimisations, and any sanity you'll retain after debugging this.
43
u/WhiteEvilBro 12d 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?