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
-5
u/sessamekesh Jul 29 '26
NICE.
This seems like a REALLY good approach. C++ had a design thesis of "zero cost abstractions" that's directly antithetical to runtime bounds checking, but in almost every scenario where I'm doing direct one-off access (as opposed to iterating a container etc.) I either want a bounds check somewhere or I'm using a custom container anyways.
I'm a pretty avid Rust user as well, and in my experience probably 6/10 of the times I lean on language safety (in a way I don't get in modern C++) it's really leaning on their "safety first, zero cost abstractions where they're safe" standard library design.