Comment

Comment by jjuhl

Yeah. const_cast (and C-style casts) and mutable existing in the language make const pretty useless to the optimizer. But at least they are trying to get some benefit from it in some cases. A C++ variant (compiler flag) that would remove const_cast, mutable and the cast-const-away parts of C-style casts from the language and allow the optimizer to put more value into 'const' could be interresting.
parent jjuhl 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton