Proposed for inclusion in boost: a C++11 span
Dear all, I started to work on a C++11 implementation of std::span. The interface will be an exact mirror of std::span, https://en.cppreference.com/w/cpp/container/span. Having a drop-in replacement of std::span for systems with older compilers in Boost seems like a very good idea. Is anyone else already working on this? I am happy to join forces. Coding down the span took me an hour, but several more hours will go into unit testing and documenting. Best regards, Hans
On Sun, 16 Jun 2019 at 16:15, Hans Dembinski via Boost < boost@lists.boost.org> wrote:
Is anyone else already working on this? I am happy to join forces. Coding down the span took me an hour, but several more hours will go into unit testing and documenting.
Save yourself the trouble and just fork and maintain https://github.com/tcbrindle/span . It's already released under BSL-1.0, so no problems there either. Then there's another one, https://github.com/martinmoene/span-lite, equally BSL-1.0. It appears std::mdspan is slightly more of a challenge. degski --- @realdegski https://edition.cnn.com/interactive/2019/06/middleeast/saudi-teen-death-pena... "Anyone who believes that exponential growth can go on forever in a finite world is either a madman or an economist" - Kenneth E. Boulding
Save yourself the trouble and just fork and maintain https://github.com/tcbrindle/span . It's already released under BSL-1.0, so no problems there either. Then there's another one, https://github.com/martinmoene/span-lite, equally BSL-1.0. It appears std::mdspan is slightly more of a challenge.
+1. They're Boost licensed, and Boost friendly authors to boot. I personally use span-lite. It works well on C++ 98, incidentally. In any case, implementation is easy, it'll be the documentation which is hard, as always. Niall
Dear degski and Niall,
On 17. Jun 2019, at 14:24, Niall Douglas via Boost
wrote: Save yourself the trouble and just fork and maintain https://github.com/tcbrindle/span . It's already released under BSL-1.0, so no problems there either. Then there's another one, https://github.com/martinmoene/span-lite, equally BSL-1.0. It appears std::mdspan is slightly more of a challenge.
+1. They're Boost licensed, and Boost friendly authors to boot.
thank you for the pointers. I will check their implementations. Do you know why were these not proposed/accepted for inclusion in Boost?
I personally use span-lite. It works well on C++ 98, incidentally.
In C++ 98 and without decltype and declval, it is more difficult to restrict the overloads of the templated constructors of span, I have to see how they do that.
In any case, implementation is easy, it'll be the documentation which is hard, as always.
For a clone of std::span, one can base the documentation on cppreference.com, which is better than developing from scratch. Best regards, Hans
On 17/06/2019 15:40, Hans Dembinski wrote:
Dear degski and Niall,
On 17. Jun 2019, at 14:24, Niall Douglas via Boost
wrote: Save yourself the trouble and just fork and maintain https://github.com/tcbrindle/span . It's already released under BSL-1.0, so no problems there either. Then there's another one, https://github.com/martinmoene/span-lite, equally BSL-1.0. It appears std::mdspan is slightly more of a challenge.
+1. They're Boost licensed, and Boost friendly authors to boot.
thank you for the pointers. I will check their implementations. Do you know why were these not proposed/accepted for inclusion in Boost?
Almost certainly because they lack the time, patience, and fortitude of will. But you'd have to ask them.
I personally use span-lite. It works well on C++ 98, incidentally.
In C++ 98 and without decltype and declval, it is more difficult to restrict the overloads of the templated constructors of span, I have to see how they do that.
I've fired it into C++ 98 codebases and it "just worked". I don't doubt there will be some corner case gotchas.
In any case, implementation is easy, it'll be the documentation which is hard, as always.
For a clone of std::span, one can base the documentation on cppreference.com, which is better than developing from scratch.
I suspect the tutorial will be the most painful part. Like, when and why to use string_view vs span vs iterator pairs vs range vs pointers? Niall
participants (3)
-
degski
-
Hans Dembinski
-
Niall Douglas