10 ms·
Yes: the implication was that the original object was `const`. If you both add and remove const, that's well-defined. (I've yet to see a C or C++ codebase wher
by woodruffw 4y ago
Yes: the implication was that the original object was `const`. If you both add and remove const, that's well-defined.
(I've yet to see a C or C++ codebase where object provenance actually guarantees this; I've see a lot of C and C++ codebases with const-stripping induced UB.)
- guipsp 4y agoIn rust, stripping const is UB - even if the original location is mut.