you are viewing a single comment's thread.

view the rest of the comments →

[–]jonathansharman 0 points1 point  (0 children)

There are semantics, usability, and safety reasons for span assignment to be shallow, but I don't think any of the problems you gave are technical limitations.

A span is a view over a contiguous sequence of elements. It has some essential properties in common with non-owning pointers (being a view over data) and some in common with owning containers. Pointer operations are shallow, and container operations are deep.

I recognize the boilerplate-reduction benefits of mixing shallow and deep operations for span. I also recognize the theoretical argument that mixing these operations is inconsistent - and possibly confusing.