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
@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
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
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 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
@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
None yet
Development

Successfully merging this pull request may close these issues.

5 participants