Skip to content

Implement LWG-4366: Heterogeneous comparison of expected may be ill-formed - #5896

Merged
Stephan T. Lavavej (StephanTLavavej) merged 7 commits into
microsoft:mainfrom
vmichal:ill-formed-heterogeneous-comparisons-of-expected
Nov 27, 2025
Merged

Implement LWG-4366: Heterogeneous comparison of expected may be ill-formed#5896
Stephan T. Lavavej (StephanTLavavej) merged 7 commits into
microsoft:mainfrom
vmichal:ill-formed-heterogeneous-comparisons-of-expected

Conversation

@vmichal

Copy link
Copy Markdown
Contributor

Implement reworded "Returns" of various operator== between expected, expected<void> and unexpected - rely on implicit conversions instead of explicit static_cast<bool>(cmp-expr).
Add tests.

Fixes #5873

@vmichal
Vojtěch Michal (vmichal) requested a review from a team as a code owner November 21, 2025 14:29
@github-project-automation github-project-automation Bot moved this to Initial Review in STL Code Reviews Nov 21, 2025
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the LWG Library Working Group issue label Nov 21, 2025
Comment thread stl/inc/expected Outdated
Comment thread tests/std/tests/P0323R12_expected/test.cpp Outdated
Comment thread tests/std/tests/P0323R12_expected/test.cpp Outdated
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Initial Review to Ready To Merge in STL Code Reviews Nov 24, 2025
@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 e7b1c23 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

❤️ 🟰 💚

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

Labels

LWG Library Working Group issue

3 participants