ORNL / ORNL/cpp-proposals-pub

Issaquah (Feb 2023) P2630R2 presentation

Open
#328 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
29
Forks
26
PR merge metrics
No merged PRs in 30d

Description

P2630R2: submdspan

submdspan: multidimensional array slicing

  • Split from P0009 after LEWG review

  • P2630 expands facility to make it work for custom layouts, and adds strided_slice

R2 changes

  • Added discussion choice of customization point mechanism

  • Renamed strided_index_range to strided_slice

  • Introduced named struct combining mapping and offset as return type for submdspan_mapping

  • Removed redundant constraints, which are covered by mandates; this improves error messages for users

Customization point mechanism

  • Paper: Section 2.1.3 "Pure ADL vs. CPO vs. tag invoke"

  • Applies P2279's criteria to judge value of different mechanisms

  • Most users will never call submdspan_mapping directly

  • submdspan_mapping only needs to be implemented for custom layout mappings, a rare use case

  • submdspan_mapping has no default implementation (unlike, say, std::swap)

  • Name submdspan_mapping is extremely specific, making opt-in essentially explicit

  • Incorrect opt-in is easy to diagnose: return type must be a layout mapping with specific extents

  • This and other discussion in paper suggest no significant benefits in preferring CPOs or tag_invoke over pure ADL for submdspan_mapping. However, we would accept LEWG's preference for tag_invoke here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue presents P2630R2, “submdspan,” and discusses its customization-point mechanism, but names no repository file, test, or entry point. Start by determining what presentation artifact is expected and how it should be added; the issue does not define a concrete completion check.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.