microsoft / microsoft/GSL

MSVC - gsl::make_span with iterators

Open
#982 7 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

Priority: Low Status: In Progress Type: Bug
Dominant language
C++
Stars
6.7k
Forks
772
Avg merge
4d 23h
Merged PRs (30d)
9

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.