There are two overloads for gsl::make_span which take a Ptr that has an element_type class member. Presumably this was introduced to handle smartpointers. However, since gsl::span itself doesn't have a way to construct a span from a smartpointer, and there is no implicit conversion from a STL smartpointer to a raw pointer, the following code doesn't compile anyways with the current implementation:
#include <gsl/span>
#include <memory>
int main()
{
std::unique_ptr<int> a(new int(42));
gsl::span<int> s = gsl::make_span(a);
}
There are two overloads for
gsl::make_span
which take aPtr
that has anelement_type
class member. Presumably this was introduced to handle smartpointers. However, sincegsl::span
itself doesn't have a way to construct a span from a smartpointer, and there is no implicit conversion from a STL smartpointer to a raw pointer, the following code doesn't compile anyways with the current implementation:The two overloads in
<span_ext>
: