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
[mdspan] require conversion results to be nonnegative #6561
Conversation
…tive "nonnegative" is meaningless for a value of some arbitrary type which we've only required to be convertible to the integral type `index_type`, so this wording clearly intends to constrain the result of the conversion.
" |
… to 0 `s[i]` is an lvalue of a type that we can only convert to `index_type`; clearly the wording intends that the result of the conversion should be `> 0`.
I've pushed two more commits fixing the same issue in a couple more places, with the expectation it will be easiest to review these together. The commits are fine-grained for ease of review and each follow the editorial guidelines so it should be possible to merge them cleanly without squashing. Shout if I made the wrong call and I should split these up into three PRs. |
[mdspan.layout.stride.cons] uses either a span or array of a type which we can only convert to `index_type` as the second argument to the exposition-only `REQUIRED-SPAN-SIZE`. We must perform that conversion before doing math with the result.
e67dcff
to
819c0a1
Compare
I should tag @jwakely for review. I know I'm near the boundary of what qualifies as editorial, and I think I'm on the right side of that boundary, but someone more objective should judge whether LWG needs to look at this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I don't think there's any doubt about what was intended, and this change expresses that more accurately.
"nonnegative" is meaningless for a value of some arbitrary type which we've only required to be convertible to the integral type
index_type
, so this wording clearly intends to constrain the result of the conversion.