Skip to content

Implement LWG-4272: For rank == 0, layout_stride is atypically convertible - #5900

Merged
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
JMazurkiewicz:lwg4272
Nov 27, 2025
Merged

Implement LWG-4272: For rank == 0, layout_stride is atypically convertible#5900
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
JMazurkiewicz:lwg4272

Conversation

@JMazurkiewicz

Copy link
Copy Markdown
Contributor

Partially implement #5856.

I believe we should close #5856 and mention LWG-4272 in #3807.

Comment thread stl/inc/mdspan
requires is_constructible_v<extents_type, _OtherExtents>
constexpr explicit(extents_type::rank() > 0) mapping(const layout_stride::mapping<_OtherExtents>& _Other) noexcept
constexpr explicit(!(extents_type::rank() == 0 && is_convertible_v<_OtherExtents, extents_type>) )
mapping(const layout_stride::mapping<_OtherExtents>& _Other) noexcept

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change requested: layout_left::mapping and layout_right::mapping vary in their noexcept // strengthened vs. noexcept, but this matches the Standard's varying noexcept, despite the fact that they both have preconditions. I think this should be an LWG issue (but am too lazybusy to report it).

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Initial Review to Ready To Merge in STL Code Reviews Nov 23, 2025
@StephanTLavavej

Copy link
Copy Markdown
Member

I've updated #3807 as you recommended!

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Ready To Merge to Merging in STL Code Reviews Nov 25, 2025
@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 1e6d927 into microsoft:main Nov 27, 2025
44 checks passed
@github-project-automation github-project-automation Bot moved this from Merging to Done in STL Code Reviews Nov 27, 2025
@StephanTLavavej

Copy link
Copy Markdown
Member

0️⃣ 🏃 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LWG Library Working Group issue mdspan C++23 mdspan

2 participants