lysdexic@programming.devM to C++@programming.devEnglish · 11 months agoC++ Should Be C++www.open-std.orgexternal-linkmessage-square6fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkC++ Should Be C++www.open-std.orglysdexic@programming.devM to C++@programming.devEnglish · 11 months agomessage-square6fedilink
minus-squaremrkite@programming.devlinkfedilinkarrow-up2·11 months 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.