Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2165R4: Compatibility Between tuple, pair, And tuple-like Objects #3372

Merged
merged 45 commits into from
Feb 26, 2023

Conversation

JMazurkiewicz
Copy link
Contributor

@JMazurkiewicz JMazurkiewicz commented Jan 30, 2023

Closes #2917.

@JMazurkiewicz JMazurkiewicz requested a review from a team as a code owner January 30, 2023 09:55
@JMazurkiewicz JMazurkiewicz changed the title P2165R4: Compatibility Between tuple, pair, And *tuple-like* Objects P2165R4: Compatibility Between tuple, pair, And tuple-like Objects Jan 30, 2023
stl/inc/tuple Outdated Show resolved Hide resolved
stl/inc/tuple Outdated Show resolved Hide resolved
stl/inc/tuple Outdated Show resolved Hide resolved
stl/inc/tuple Show resolved Hide resolved
@StephanTLavavej StephanTLavavej added the cxx23 C++23 feature label Jan 30, 2023
@JMazurkiewicz

This comment was marked as outdated.

@StephanTLavavej StephanTLavavej self-assigned this Jan 31, 2023
@StephanTLavavej

This comment was marked as resolved.

@StephanTLavavej

This comment was marked as resolved.

@cor3ntin
Copy link

LWG issue for the friendship bug with proposed resolution (matching this implementation) https://cplusplus.github.io/LWG/issue3882 (Thanks for pinging me about that!)

Copy link
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

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

Pushing a partial review; should finish tmrw

stl/inc/tuple Show resolved Hide resolved
stl/inc/tuple Outdated Show resolved Hide resolved
stl/inc/tuple Outdated Show resolved Hide resolved
stl/inc/tuple Outdated Show resolved Hide resolved
stl/inc/tuple Outdated Show resolved Hide resolved
Copy link
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

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

This looks great; thanks @JMazurkiewicz!

stl/inc/xutility Outdated Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

Looks good to me too. I've pushed one last commit to improve the merge with #3483's reformatting, FYI @strega-nil-ms.

@StephanTLavavej StephanTLavavej self-assigned this Feb 24, 2023
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej
Copy link
Member

I've pushed a commit to address several issues that I found while mirroring:

  • Work around VSO-1753916 'C++23 tuple causes x86chk assertion: !"If lookup found RDSymbol before it should find something this time, too", ParseTree.cpp 10376'. This affects _Can_equal_compare_with_tuple_like_v, which uses a pattern that we've never used in the STL before. As it's used only to emit a nice error message for Mandates, I'm simply skipping it for C1XX.
  • For tuple_cat(), go back to using typename _Tuple_cat1<_Tuples...>::_Ret instead of auto. This fixes a highly unusual scenario where real world code uses decltype to ask what the result of tuple_cat() of tuple<Abstract> would be. We can mechanically form the return type with the struct machinery, we just can't actually instantiate such a tuple.
  • This also requires that we constrain _Tuple_cat1 in C++23 mode, identically to how tuple_cat() is constrained. This allows the entire function to SFINAE away if called with something that isn't tuple-like, such as int.

@StephanTLavavej StephanTLavavej merged commit 165e96f into microsoft:main Feb 26, 2023
@StephanTLavavej
Copy link
Member

Thanks again, one more step closer to C++23! 😻 🎉 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx23 C++23 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P2165R4 Compatibility Between tuple, pair, And tuple-like Objects
6 participants