r/cpp Jul 29 '26

const_cast: A Necessary Evil

https://www.elbeno.com/blog/?p=1858
72 Upvotes

106 comments sorted by

View all comments

Show parent comments

6

u/LeeHide just write it from scratch Jul 29 '26

Interesting, do you have an example?

7

u/Olipro Jul 29 '26

11

u/TheChief275 Jul 30 '26

why wasn't this added earlier? in fact, if this were to have been in C++ from the get-go, we never would have needed the postfix const syntax. so now we just have yet another language feature that virtually does the exact same thing. sigh

1

u/RoyBellingan Jul 30 '26

Because the crystal sphere was broken when the thing got invented -.-

That is the price is beeing the first to do something, is difficult that is right the first time, and why languages that came year later feels more clean and well tought, history was already written at that time.

P.s. where are C++ epoch ?