Skip to content

MSVC - gsl::make_span with iterators #982

@dingari

Description

@dingari

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.

Metadata

Metadata

Labels

Type

Projects

Status

Assigned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions