lysdexic@programming.devM to C++@programming.devEnglish · 1 year agoC++ Should Be C++www.open-std.orgexternal-linkmessage-square6fedilinkarrow-up10arrow-down10
arrow-up10arrow-down1external-linkC++ Should Be C++www.open-std.orglysdexic@programming.devM to C++@programming.devEnglish · 1 year agomessage-square6fedilink
minus-squaremrkite@programming.devlinkfedilinkarrow-up1·1 year agoIt violates the principle of least surprise. You don’t expect the compiler to delete your bounds checking etc. The way c and c++ define and use UB is like finding an error at compile time and instead of reporting it, the compiler decides to exploit it.
It violates the principle of least surprise. You don’t expect the compiler to delete your bounds checking etc.
The way c and c++ define and use UB is like finding an error at compile time and instead of reporting it, the compiler decides to exploit it.