Layout mappings and submdspan must take index resp. slice types convertible to index_type
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 507
- Forks
- 87
- Avg merge
- 15h 27m
- Merged PRs (30d)
- 2
Description
The Standard layout mappings' operator() accept arguments that are not integers, as long as
- they are convertible to
index_type, and index_typeis nothrow-constructible from them.
See e.g., [mdspan.layout.left.obs] 2. Also, submdspan accepts as a valid slice type any argument that models convertible_to<index_type>. However, the current reference mdspan implementation cannot handle either of these cases.
I have a branch that implements D3663R2 (if you enable a CMake option MDSPAN_ENABLE_P3663 that defaults to OFF). In that branch, I have a commit that fixes this bug (also for the non-D3663R2 case). The commit also adds regression tests for both layout mapping indexing and submdspan slicing.
@youyu3 This may be relevant to your interests.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked commit d77b1a74b20efdf5cf06765438968d87cb3d15d4 and its regression tests for layout mapping indexing and submdspan slicing. Run the relevant test suite with and without MDSPAN_ENABLE_P3663; done means both convertible index and slice types are handled in each configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100