Skip to content

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
@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.

@strega-nil-ms strega-nil-ms self-requested a review February 7, 2023 17:32
@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

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!

@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