Created on 2023-02-09.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to n4928.
Modify [mdspan.layout.left.overview] as indicated:
-2- If Extents is not a specialization of extents, then the program is ill-formed.
-3- layout_left::mapping<E> is a trivially copyable type that models regular for each E. -?- Mandates: If Extents::rank_dynamic() == 0 is true, then the size of the multidimensional index space Extents() is representable as a value of type typename Extents::index_type.
Modify [mdspan.layout.right.overview] as indicated:
-2- If Extents is not a specialization of extents, then the program is ill-formed.
-3- layout_right::mapping<E> is a trivially copyable type that models regular for each E. -?- Mandates: If Extents::rank_dynamic() == 0 is true, then the size of the multidimensional index space Extents() is representable as a value of type typename Extents::index_type.
Modify [mdspan.layout.stride.overview] as indicated:
-2- If Extents is not a specialization of extents, then the program is ill-formed.
-3- layout_stride::mapping<E> is a trivially copyable type that models regular for each E. -?- Mandates: If Extents::rank_dynamic() == 0 is true, then the size of the multidimensional index space Extents() is representable as a value of type typename Extents::index_type.
[ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Immediate → WP. ]
[ Issaquah 2023-02-10; LWG issue processing ]
Move to Immediate for C++23
As shortly discussed during the LWG review of a layout_stride defect, there is currently no protection against creating layout mappings with all static extents where the product of those extents exceeds the representable value range of the index_type.
For example, the following statement does not violate any preconditions or mandates:layout_left::mapping<extents<int, 100000, 100000>> a{};
But a.required_span_size() would overflow since the implied span size is 10B and thus exceeds what int can represent.
This is only a problem for all static extents, since with any dynamic extent in the mix the implied span size is 0. Hence we can check for this via a mandates check on the class. The paper P2798R0 has been provided with the proposed wording as shown below.History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2023-02-13 11:31:32 | admin | set | messages: + msg13401 |
2023-02-13 11:31:32 | admin | set | status: immediate -> wp |
2023-02-10 18:05:30 | admin | set | messages: + msg13339 |
2023-02-10 18:05:30 | admin | set | status: new -> immediate |
2023-02-09 18:21:26 | admin | set | messages: + msg13312 |
2023-02-09 00:00:00 | admin | create |