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
-1
u/sessamekesh Jul 29 '26 edited Jul 29 '26
I'll copy my other comment.
If "you'd have to do it anyways" was a good defining property of a zero cost abstraction, you could call the entirety of a windowing layer like GLFW "zero-cost," which I find pretty silly.
EDIT: A contrived example for why runtime bounds checks should not be considered always appropriate: