c++c++20outofrangeexceptionstd-span

How do you do bounds checking with std span?


std::vector and pretty much all other containers have a very convenient way of bounds checking: at(). std::span doesn't have that apparently.


Solution

  • std::span::at will be added in C++26.