2 ms·
> 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 implem
by stefanos82 3y ago
> 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 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."
- pjmlp 3y agoYou missed the Std column => (C++26)