
Andrey Semashev wrote:
And fixed extents are not as useful as the dynamic extent in general, in my experience, as most of the time we deal with variable-sized sequences.
I also used to think that way, but that was because I didn't understand
the purpose of span.
The purpose of span is to replace pointer arguments. If your function
takes
void f1( unsigned char p[] );
you use
void f1( span<unsigned char> p );
and if it takes
void f2( unsigned char p[4] );
you use
void f2( span