Section: 23.7.3.4.8.1 [mdspan.layout.leftpad.overview], 23.7.3.4.9.1 [mdspan.layout.rightpad.overview] Status: New Submitter: Luc Grosheintz Opened: 2025-09-09 Last modified: 2025-09-19
Priority: Not Prioritized
View all issues with New status.
Discussion:
Two new layouts were added to <mdspan> in C++26. Both have a template
parameter size_t PaddingValue. This value is allowed to be std::dynamic_extent
to signal that the padding value isn't known at compile time.
PaddingValue is representable as a value of index_type.
Since std::dynamic_extent is defined as size_t(-1) (in 23.7.2.1 [span.syn])
this immediately prohibits all dynamically padded layout mappings for
any index_type for which:
numeric_limit<index_type>::max() < numeric_limit<size_t>::max()
One example is int on a 64-bit system.
rank <= 1, even though in that case the
PaddingValue has no other effect. Hence, the Mandates: element could
be weakened further.
Proposed resolution:
This wording is relative to N5014.
Modify 23.7.3.4.8.1 [mdspan.layout.leftpad.overview] as indicated:
-5- Mandates:
(5.1) — […]
(5.2) — if
padding_valueis not equal todynamic_extent, thenpadding_valueis representable as a value of typeindex_type.(5.3) — […]
(5.4) — […]
Modify 23.7.3.4.9.1 [mdspan.layout.rightpad.overview] as indicated:
-5- Mandates:
(5.1) — […]
(5.2) — if
padding_valueis not equal todynamic_extent, thenpadding_valueis representable as a value of typeindex_type.(5.3) — […]
(5.4) — […]