Re:Why Const Doesn't Make C Code Faster
by MauranKilom on Monday August 19, 2019 @07:06PM
(#20742560)
> The function is allowed to cast away const and modify the object.
Correct, but only if the original (referenced) object is not const itself. Casting away constness to modify an object that was declared const is 100% UB.
Correct, but only if the original (referenced) object is not const itself. Casting away constness to modify an object that was declared const is 100% UB.