[mdspan.sub.sub] Fix submdspan slice canonicalization#8996
Merged
tkoeppe merged 1 commit intoMay 12, 2026
Conversation
Two integration errors in the Let clause introduced by P3663R3: - the function parameter pack is named "slices", but the Let clause references an undefined "raw_slices"; rename the parameter to match subextents (mdspan.sub.extents); - src is an mdspan but canonical_slices takes an extents object; pass src.extents() instead of src.
jwakely
approved these changes
May 12, 2026
| constexpr auto submdspan( | ||
| const mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>& src, | ||
| SliceSpecifiers... slices) -> @\seebelow@; | ||
| SliceSpecifiers... raw_slices) -> @\seebelow@; |
Member
There was a problem hiding this comment.
This was just a misapplication of the paper. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html#change-mdspan.sub.sub-submdspan-function-template said to change this.
| constexpr auto submdspan( | ||
| const mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>& src, | ||
| SliceSpecifiers... slices) -> @\seebelow@; | ||
| SliceSpecifiers... raw_slices) -> @\seebelow@; |
Member
There was a problem hiding this comment.
This should have been changed by the paper, to match the change to [mdspan.sub.sub] in the paper.
| Let \tcode{slices} be the pack introduced by the following declaration: | ||
| \begin{codeblock} | ||
| auto [...slices] = canonical_slices(src, raw_slices...); | ||
| auto [...slices] = canonical_slices(src.extents(), raw_slices...); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two integration errors in
submdspan's slice canonicalization Let clause introduced by P3663R3:slices, but the Let clause references an undefinedraw_slices; rename the parameter to matchsubextents([mdspan.sub.extents]).srcis anmdspanbutcanonical_slicestakes anextentsobject ([mdspan.sub.canonical]); passsrc.extents()instead ofsrc.