Issaquah (Feb 2023) P1684R4 LEWG feedback
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- backend-api-design
Research direction
No source files, tests, or implementation entry points are named. Start by reviewing the P1684R4 design and the listed LEWG questions about extraction, moved-from states, vector accessors, feature-test macros, and formatting. Done requires an agreed resolution for the design questions, but the issue does not define one.
Written by the indexing model from the issue text.
Description
Issaquah (Feb 2023) P1684R4 LEWG feedback
Extraction of container from the mdarray
LEWG audience asked about "extraction" of the container from the mdarray. One application would be reinterpreting the data without reallocation, by moving the container out of one mdarray, and into a different mdarray with a different layout and/or extents.
Our objection to this was and is that if the mdarray had all static extents, then it would have no way to "zero out" the extents after extraction. The resulting mdarray would have a nonempty multidimensional index space domain, but no valid elements. (For example, consider an mdarray with extents<int, 2, 3, 4> but std::vector container. Extraction of the storage would leave the mdarray with no storage, but with a layout mapping that would accept any multidimensional index in extents<int, 2, 3, 4>.)
The counter is that mdarray already has a move constructor and a move assignment operator. What would happen to the moved-from object in these cases? Some LEWG members suggested constraining these operators on whether rank_dynamic() != 0. Regardless, the "extracted-from" state is the same as the "moved-from" state; the problems are the same for both.
Custom containers add another aspect to this issue. std::vector carefully specifies its moved-from state, but a custom container could have a moved-from state with invalid storage and an incorrectly preserved size().
Another question is whether the move constructor might need to allocate, in which case it might throw and thus should not be marked noexcept.
Are we concerned that a matrix of bool would default to std::vector<bool>?
This would actually affect the default accessor type that to_mdspan would use. We couldn't use default_accessor<bool> in this case, because std::vector<bool> doesn't actually store an array of bool. What we would need is some kind of "container_accessor" that perhaps defaults to default_accessor<element_type> if the container's reference and pointer types are suitable.
Other points
-
Feature test macro?
-
Format facilities interaction?
- It would make sense for us to do that through mdspan first, in a separate paper.
- Dominant language
- HTML
- Stars
- 29
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from ORNL/cpp-proposals-pub
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
ORNL/cpp-proposals-pub#394 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
ORNL/cpp-proposals-pub#393 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ORNL/cpp-proposals-pub#297 ·
-
P3242: LWG ReviewOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ORNL/cpp-proposals-pub#484 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ORNL/cpp-proposals-pub#483 · 2 comments ·
All issues in ORNL/cpp-proposals-pub
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
crowdin/crowdin-api-client-java#441 ·
Maintainers usually reply within 1 day
-
PROCESSED_DATA_FOLDER: strip whitespace and treat empty as unsetPossibly taken @TorecLuik claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
NL-BioImaging/BIOMERO.importer#63 ·
Maintainers usually reply within 1 day
-
Bug Ruby
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-ruby#3211 · 1 comment ·
Maintainers usually reply within 2 days
-
Microsoft Outlook add attachment reads the binary field from item 0Possibly taken @joshbarros claimed this today. Openstatus:in-linear
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
n8n-io/n8n#44021 · 2 comments ·
Maintainers usually reply within 1 day