KEMBAR78
`<ranges>`: Make `ranges::to` support creating unions by frederick-vs-ja · Pull Request #5794 · microsoft/STL · GitHub
Skip to content

Conversation

@frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Oct 21, 2025

Union types are also class types in the C++ core language, and [range.utility.conv.adaptors] doesn't exclude them.

LWG-4229 attempted to clarify that unions are unsupported, but it's recently set to Tentatively NAD. As a result, we should support creating unions.

Union types are also class type in the C++ core language, and
[range.utility.conv.adaptors] doesn't exclude them. LWG-4229 attempted
to clarify that unions are unsupported, but it's recently set to
Tentatively NAD. As a result, we should support creating unions.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner October 21, 2025 02:13
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Oct 21, 2025
@StephanTLavavej StephanTLavavej added bug Something isn't working ranges C++20/23 ranges labels Oct 21, 2025
@StephanTLavavej
Copy link
Member

Thanks! 😻 I audited all other uses of is_class and found no other occurrences.

@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Oct 21, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Oct 22, 2025
@StephanTLavavej
Copy link
Member

I've pushed a commit to drop "(including union)" as recommended by @cpplearner, and increased the precision of our Standard citations.

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

@StephanTLavavej StephanTLavavej merged commit 78bb452 into microsoft:main Oct 22, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Oct 22, 2025
@StephanTLavavej
Copy link
Member

Thanks for fixing this highly obscure bug! 🐞 🪲 🐝

@frederick-vs-ja frederick-vs-ja deleted the ranges-to-union branch October 22, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ranges C++20/23 ranges

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants