NanoRange icon indicating copy to clipboard operation
NanoRange copied to clipboard

Add std::span implementation

Open tcbrindle opened this issue 5 years ago • 0 comments

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.

tcbrindle avatar Nov 25 '19 16:11 tcbrindle