News for hackers. Stuff that matters.
Re:Optimizing C++ Const Objects in LLVM by plorkyeran on Sunday December 27, 2015 @11:16AM (#10797819)
const_cast<> isn't the root of the problem. If someone passes you a pointer to a const pointer to a non-const thing, they can still just mutate the non-const thing without any casts. You'd have to forbid non-const to const pointer conversions entirely (which would imply removing const_cast<>, as there would no longer be any situations in which it was legal to use).
Re:Optimizing C++ Const Objects in LLVM by jjuhl on Sunday December 27, 2015 @11:21AM (#10797828)
Right. There are lots of corner cases that would need to be identified and considered in the case of a "strong const" C++ variant (like what you point out) - I still think it could be an interresting experiment.