This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Ready status.
layout_stride::is_exhaustive specification is problematic when there's an extent equal to 1Section: 23.7.3.4.7.4 [mdspan.layout.stride.obs] Status: Ready Submitter: S. B. Tam Opened: 2026-03-29 Last modified: 2026-06-11
Priority: 3
View all issues with Ready status.
Discussion:
Consider
constexpr std::extents ext{2, 1, 2};
constexpr std::array stride{1, 5, 2};
constexpr std::layout_stride::mapping lsm(ext, stride);
static_assert(lsm.is_exhaustive());
Implementations disagree on the result of lsm.is_exhaustive(): true on libstdc++ and libc++, false on MSVC STL.
false.
Should is_exhaustive be made to return true in this case (which is more correct and also easier to implement)?
[2026-05-29; Reflector poll.]
Set priority to 3 after reflector poll.
[2026-06-10; Tomasz provides new wording]
Reflect implementation in the wording.
[Brno 2026-06-11; Change status: New → Ready.]
Proposed resolution:
This wording is relative to N5008.
Modify 23.7.3.4.7.4 [mdspan.layout.stride.obs] as indicated:
constexpr bool is_exhaustive() const noexcept;-5- Returns:
required_span_size() == extents().fwd-prod-of-extents(rank_).
(5.1) —trueifrank_or the size of the multidimensional index spacem.extents()is0.
(5.2) — Otherwise,trueif there is a permutationPof the integers in the range[0, rank_)such thatstride(p0)equals1, andstride(pi)equalsstride(piā1) * extents().extent(piā1)for i in the range[1, rank_), wherepiis the ith element ofP.
(5.3) — Otherwise,false.