Hacker News new | past | comments | ask | show | jobs | submit login

> Herb mentions std::span as as safety improvement but the [] operator doesn't do bounds checks and the .at() method isn't even there yet!

You mean this implementation? https://en.cppreference.com/w/cpp/container/span/at

To quote: "Returns a reference to the element at specified location pos, with bounds checking.

If pos is not within the range of the span, an exception of type std::out_of_range is thrown."




You missed the Std column => (C++26)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: