Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWG-3320 span::cbegin/cend methods produce different results than std::[ranges::]cbegin/cend #542

Closed
StephanTLavavej opened this issue Feb 26, 2020 · 3 comments · Fixed by #548
Labels
fixed Something works now, yay! LWG Library Working Group issue
Milestone

Comments

@StephanTLavavej
Copy link
Member

LWG-3320 span::cbegin/cend methods produce different results than std::[ranges::]cbegin/cend

@StephanTLavavej StephanTLavavej added the LWG Library Working Group issue label Feb 26, 2020
@miscco
Copy link
Contributor

miscco commented Feb 26, 2020

I Starter this, however now I am unsure whether we would want to remove the conversion operator entirely so that span_iterator<int> is not convertible to span_iterator<const int>

@StephanTLavavej
Copy link
Member Author

I believe that the conversion operator needs to be removed. After this LWG issue resolution, the container requirements for the relationship between iterator and const_iterator don't apply (as const_iterator is gone), and there is no specified relationship between span<int>::iterator and span<const int>::iterator. (A user can still convert span<int> to span<const int> and then call begin().)

@miscco
Copy link
Contributor

miscco commented Feb 26, 2020

Thats what I thought too, but I wanted to get some confirmation before I push that change.

I will try to get a similar PR for libc++ to remove the corresponding tests and in the meanwhile disable the tests here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Something works now, yay! LWG Library Working Group issue
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants