Title
`std::dynamic_extent` should also be defined in <mdspan>
Status
new
Section
[mdspan.syn]
Submitter
Aiden Grossman

Created on 2025-06-06.00:00:00 last changed 3 weeks ago

Messages

Date: 2025-06-10.09:34:04

Proposed resolution:

This wording is relative to N5008.

  1. Modify [views.general] as indicated:

    The header <span> ([span.syn]) defines the view `span`. The header <mdspan> ([mdspan.syn]) defines the class template `mdspan` and other facilities for interacting with these multidimensional views.

    -?- In addition to being available via inclusion of the <span> header, `dynamic_extent` is available when the header <mdspan> is included.

Date: 2025-06-15.00:00:00

[ 2025-06-10; Jonathan provides improved wording ]

Date: 2025-06-10.09:34:04

`std::dynamic_extent` can be used in certain circumstances in `std::mdspan`, such as with padded layouts. However, `std::dynamic_extent` is currently only defined in <span> which necessitates including <span> solely for the `std::dynamic_extent` definition.

This wording is relative to N5008.

  1. Modify [mdspan.syn], header <span> synopsis, as indicated:

    // all freestanding
    namespace std {
      // constants
      inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();
      
      // [mdspan.extents], class template extents
      template<class IndexType, size_t... Extents>
      class extents;
    
      […]
    }
    
History
Date User Action Args
2025-06-10 09:34:04adminsetmessages: + msg14786
2025-06-07 14:02:46adminsetmessages: + msg14785
2025-06-06 00:00:00admincreate