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 (changes to pair only) #3323

Merged
merged 16 commits into from Jan 22, 2023

Conversation

JMazurkiewicz
Copy link
Contributor

@JMazurkiewicz JMazurkiewicz commented Jan 4, 2023

Towards #2917. Implements changes to [pairs] section.

The other goal of this PR is to move around some stuff, so that implementation of tuple-like concept is possible:

  • Move _Different_from concept from <xutility> to <utility>,
  • Move _Is_subrange variable template from <ranges> to <utility> and rename it to _Is_subrange_v,
  • Move _Is_std_array_v variable from <span> to <utility>,
  • Remove some redundant forward declarations.

* Implement pair-like concept
* Change header dependency -> now `<utility>` includes `<__msvc_iter_core.hpp>`, not the other way around
* Move `tuple_size`, `tuple_element` and some internal machinery to `<__msvc_iter_core.hpp>`
* `<tuple>` and `<xutility>` headers include `<utility>` now (not `<__msvc_iter_core.hpp>`)
* Relocate some more stuff inside of `<utility>` header and add `pair` forward declaration
* Move `_Different_from` concept from `<xutility>` to `<utility>
* Move `_Is_subrange` variable from `<ranges>` to `<utility>` and rename it to `_Is_subrange_v`
* Move `_Is_std_array_v` variable from `<span>` to `<utility>`
@JMazurkiewicz JMazurkiewicz requested a review from a team as a code owner January 4, 2023 12:09
@CaseyCarter CaseyCarter added the cxx23 C++23 feature label Jan 4, 2023
@CaseyCarter CaseyCarter added this to Initial Review in Code Reviews via automation Jan 4, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jan 4, 2023
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja left a comment

Choose a reason for hiding this comment

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

I'm afraid that changing header depencendy might damage throughput (although perhaps slightly).

stl/inc/utility Outdated Show resolved Hide resolved
stl/inc/utility 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! One minor change requested - can you drop the strict requirement on the test?

tests/std/tests/P2165R4_tuple_like_pair/env.lst Outdated Show resolved Hide resolved
Code Reviews automation moved this from Initial Review to Work In Progress Jan 5, 2023
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.

😻

@StephanTLavavej StephanTLavavej moved this from Work In Progress to Final Review in Code Reviews Jan 10, 2023
@StephanTLavavej
Copy link
Member

Thanks - flawless product code as far as I can tell! 😻 I pushed a commit to drop std:: qualification for vector in the test, plus a conflict-free merge with main since I was pushing changes anyways.

@StephanTLavavej StephanTLavavej removed their assignment Jan 20, 2023
@StephanTLavavej StephanTLavavej moved this from Final Review to Ready To Merge in Code Reviews Jan 20, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jan 21, 2023
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit 1072296 into microsoft:main Jan 22, 2023
Code Reviews automation moved this from Ready To Merge to Done Jan 22, 2023
@StephanTLavavej
Copy link
Member

Thanks again for implementing more of this C++23 feature! 😻 📉 🎉

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

Successfully merging this pull request may close these issues.

None yet

5 participants