I have some code that uses gsl::make_span(cont.begin(), cont.end()) quite heavily. This compiles fine on macOS and Linux with GCC and Clang, but fails on MSVC. Instead, I have to use gsl::make_span(cont.data(), std::distance(cont.begin(), cont.end())) - which becomes pretty tedious and illegible.
Here's a quick example. Is there another overload we can use?
We can't pass the whole container to make_span, since we sometimes have varying end iterators returned from algorithms.
I have some code that uses
gsl::make_span(cont.begin(), cont.end())quite heavily. This compiles fine on macOS and Linux with GCC and Clang, but fails on MSVC. Instead, I have to usegsl::make_span(cont.data(), std::distance(cont.begin(), cont.end()))- which becomes pretty tedious and illegible.Here's a quick example. Is there another overload we can use?
We can't pass the whole container to
make_span, since we sometimes have varying end iterators returned from algorithms.