r/cpp • u/pavel_v • Jul 29 '26
C++26: Reducing undefined behaviour
https://www.sandordargo.com/blog/2026/07/29/cpp26-reduces-undefined-behaviour
89
Upvotes
r/cpp • u/pavel_v • Jul 29 '26
View all comments
Show parent comment
3
u/Potterrrrrrrr Jul 29 '26
It can still be zero cost, it’s just that zero cost is referring to safety too instead of solely referring to performance. I would expect the bounds checking itself to be zero cost in that regard at least. It’s a bit of a weird term to use when no abstraction is truly zero cost, makes it a bit difficult to talk about when discussing these sorts of things.