boostorg / core

Boost Core Utilities
132 stars 86 forks source link

boost::span does not have constructors with iterators #152

Closed hadrielk closed 11 months ago

hadrielk commented 11 months ago

In C++20 std::span supports iterator arguments for a couple of its constructor signatures. boost::span does not - only raw pointers.

That means one cannot do this:

std::vector<int> vec{1,2,3,4};

boost::span<int> sp1(vec.begin(), vec.end()); // error
boost::span<int> sp2(vec.begin(), 2); // error

I can provide a PR, if you wish.

glenfe commented 11 months ago

See https://github.com/boostorg/core/issues/119

hadrielk commented 11 months ago

Oops, I should have looked at the close issues - thanks @glenfe.