Another issue that is due to be voted on in Kona.
Since we have two implementations of span - one for dynamic extents, and one for static, this was simple.
Details
Diff Detail
Event Timeline
test/std/containers/views/span.cons/container.fail.cpp | ||
---|---|---|
72 | Why does this fail? Shouldn't this use std::span<int, std::dynamic_extent>::span(Container const&)? | |
100 | Just to make sure I understand -- this is the only test that checks the actual changes in LWG3101, i.e. the removal of support for constructing a statically-sized std::span from a dynamically-sized std::span. Other changes just remove tests that shouldn't be passing (or don't make sense) anymore. |
test/std/containers/views/span.cons/container.fail.cpp | ||
---|---|---|
72 | Because it's an rvalue? Dunno; but if so, that makes all the other tests useless. I will investigate. | |
100 | Correct. I removed all the different combinations of const/non-const etc because I removed the ctor, and left a single test behind to make sure that the ctor is not found. |
This LGTM but I'd like to understand the situation I commented on with the rvalue before we commit this.
test/std/containers/views/span.cons/container.fail.cpp | ||
---|---|---|
72 | I think it should compile because the Container const& will bind to a rvalue (and then the std::span contains a dangling reference). |
test/std/containers/views/span.cons/container.fail.cpp | ||
---|---|---|
72 | If I was creating a span<const int>, then yes, but not a span<int> |
Why does this fail? Shouldn't this use std::span<int, std::dynamic_extent>::span(Container const&)?