Marek Knápek@programming.dev to Programming@programming.dev · 2 years agoThe Little Things: The Missing Performance in std::vectorcodingnest.comexternal-linkmessage-square11linkfedilinkarrow-up149arrow-down12 cross-posted to: cpp@programming.dev
arrow-up147arrow-down1external-linkThe Little Things: The Missing Performance in std::vectorcodingnest.comMarek Knápek@programming.dev to Programming@programming.dev · 2 years agomessage-square11linkfedilink cross-posted to: cpp@programming.dev
minus-squarerobinm@programming.devlinkfedilinkarrow-up1·2 years agoIn C++ integer overflow is UB so this edge case cannot exist
minus-squarekornel@programming.devlinkfedilinkarrow-up3·2 years agoOnly signed overflow. size_t is unsigned.
minus-squarerobinm@programming.devlinkfedilinkarrow-up1·edit-22 years agoThat’s totally right but I thought you were talking about signed numbers since you said “integer overflow”. I forgot that len is usually unsigned in C++.
In C++ integer overflow is UB so this edge case cannot exist
Only signed overflow. size_t is unsigned.
That’s totally right but I thought you were talking about signed numbers since you said “integer overflow”. I forgot that
len
is usually unsigned in C++.