P3982R0 — Fix meaning of strided_slice::extent for C++26 (30 items) Library Evolution Working Group
Tomasz Kamiński, Mark Hoemmen
This paper proposes renaming strided_slice to extent_slice and redefining its extent member to represent the output extent (number of elements) rather than the input span, resolving ambiguity and enabling zero strides and static extents with dynamic strides. It also proposes a new range_slice vocabulary type expressing the (first, last, stride) interface consistent with other programming languages, and extends slice canonicalization to accept any type decomposable into three values as a (first, last, stride) slice. The rename and semantic fix target C++26, while range_slice and decomposable slice extensions may target later standards.

References — Anthropic Citations API

[1]
"(§1) "Rename strided_slice to extent_stride and adjust the meaning of its extent member" / (§4) "Rename strided_slice to extent_stride and adjust the meaning of extent member""
[2]
""auto smd = sumdspan(md, strided_slice{cw<0>, cw<5>, md.extents()[0] / 5})""
[3]
""auto smd = submdspan(md, strided_slice{3, 5, 0};""
[4]
""return strided_slice{ .offset = canonical-index(std::move(s.extent)), .extent = canonical-index(std::move(s.offset)), .stride = canonical-index(std::move(s.stride)) }""
[5]
"Definition: "constexpr auto canonical-range-slice(OffsetType offset, SpanType span, StrideTypes... strides);" / Call site: "return canonical-slice-range(""
[6]
""strided_slice{ .offset = first, .extent = extent, .stride = stride };""
[7]
""templatelt&;class IndexType, class S>""
[8]
""[[no_unique_addresss]] FirstType first{};" (repeated for all three members)"
[9]
""S is a submdspan slice type for IndexTye.""
[10]
""stride_slice needs to target C++26""
[11]
""StridesTypes...[0] otherwise;""
[12]
""sizeof..(StrideTypes) <= 1""
[13]
""Futhermore, we propose to introduce a new vocabulary type""
[14]
""Based on the inituition built from other languages""
[15]
""it is important that the interface is both mininal""
[16]
""the ergonomics of submdspan would be severly degraded""
[17]
""even for programmers familar with the topic""
[18]
""S::extent_type::value is greater then zero""
[19]
""3. Accept any type decomposable into three elements as submdspan slice type as proposed in P3982R0 to C++29." followed by "3. Accept any type decomposable into three elements as submdspan slice..."
[21]
""indicates""
[22]
""One argument for using the input span as the value of stride_slice::extent""
[23]
""if S::offset_type specialization of constant_wrapper""
[24]
"First: "-8.1.3.2- if S::offset_type specialization of constant_wrapper" / Second: "-8.1.3.2- if S::stride_type is specialization of constant_wrapper""
[25]
""-4.2.2- if S::stride_type and S::extent_type are both specializations of constant_wrapper""
[26]
""Note that the number of number of elements in the smd is always known statically""
[28]
""the third value is the stride.""
[29]
""rust""
Summary: P3982R0 proposes three changes to strided_slice for C++26: redefining the extent member to denote the number of elements rather than the index-space end, renaming strided_slice to extent_slice, and adding a range_slice helper that preserves the old offset/extent/stride interface. The proposed wording contains several substantive errors in the normative text alongside numerous surface-level typos and markup defects.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.