Skip to content

Conversation

@tcbrindle
Copy link
Owner

std::span is a really weird thing, behaving like a view of a contiguous range (except that it sometimes doesn't actually model the view concept), but built using C++17-era idioms rather than the shiny new ranges stuff, and living in a completely different section of the standard.

This implementation of span is based on my own from https://github.com/tcbrindle/span, but simplified by assuming C++17 support and removing all the custom bounds-checking macro stuff -- this implementation just use uses plain old assert(). I believe it to be conforming to the current (pre-Belfast) working draft.

The tests are taken (as usual) from CMCSTL2, which in turn took them from the Microsoft GSL span implementation. I have modified them to remove/comment out various things which fail -- correctly, I think? -- due to the numerous changes span has undergone during its many visits to L(E)WG.

std::span is a really weird thing, behaving like a view of a contiguous range (except that it sometimes doesn't actually model the `view` concept), but built using C++17-era idioms rather than the shiny new ranges stuff, and living in a completely different section of the standard.

This implementation of span is based on my own from https://github.com/tcbrindle/span, but simplified by assuming C++17 support and removing all the custom bounds-checking macro stuff -- this implementation just use uses plain old assert(). I believe it to be conforming to the current (pre-Belfast) working draft.

The tests are taken (as usual) from CMCSTL2, which in turn took them from the Microsoft GSL span implementation. I have modified them to remove/comment out various things which fail -- correctly, I think? -- due to the numerous changes span has undergone during its many visits to L(E)WG.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants