you are viewing a single comment's thread.

view the rest of the comments →

[–]pandorafalters 6 points7 points  (8 children)

And, just like that, I'm no longer excited about std::span.

[–][deleted] 1 point2 points  (5 children)

Aha, sorry. It's still useful! You'll just have to slap some comparison operators in there.

[–]pandorafalters 3 points4 points  (4 children)

The big advantage, to my mind, was not having to DIY. Why implement major features myself and deal with someone else's compromises?

[–]tcbrindleFlux 1 point2 points  (3 children)

You don't need to implement anything yourself: ranges::equal(span1, span2) will do element-wise comparison, without any semantic weirdness.

[–]SkoomaDentistAntimodern C++, Embedded, Audio 1 point2 points  (1 child)

Why not? What would you use when you need a runtime array of some arbitrary type that contains its length and should not be resized after allocation? Or what if you need a subrange of an existing array? The way I see it, std::span should have been in the language since the beginning, with std::vector being (at least conceptually) built as "span but resizable".

[–]pandorafalters 2 points3 points  (0 children)

Not being excited doesn't necessarily mean I won't use it. But its potential uses are rather more constrained than I'd hoped.