I know std::span is static. It is just view over bunch of vector/array/etc. elements.
I see constructors of span, and it seems like std::dynamic_extent is used in 4-6. But in those constructors, there is a required template parameter for the size - std::size_t N. To me this means that the size/count/len is known at compile time. So what really is std::dynamic_extent?
The definition of
std::dynamic_extentisIt's a special value of a
std::size_tthat's used to indicate that thestd::spanhas a dynamic extent.The "size" of the
std::spanis still specified at compile time, it's just that when the "size" takes on that special value, it's treated as a dynamic extent.