Skip to content

Implement LWG-3617: function/packaged_task deduction guides and deducing this - #2966

Merged
Stephan T. Lavavej (StephanTLavavej) merged 12 commits into
microsoft:mainfrom
frederick-vs-ja:lwg-3617
Aug 5, 2022
Merged

Implement LWG-3617: function/packaged_task deduction guides and deducing this#2966
Stephan T. Lavavej (StephanTLavavej) merged 12 commits into
microsoft:mainfrom
frederick-vs-ja:lwg-3617

Conversation

@frederick-vs-ja

Copy link
Copy Markdown
Contributor

Fixes #2952.

I think we should detect the predefined core language feature-test macro __cpp_explicit_this_parameter, but MSVC didn't define it in VS2022 17.2 and 17.3, so I filed DevCom-10107077.

I can imagine the future where there will be "C++17/20 with explicit object parameters" dialects, so I guess we should not restrict these library changes to C++23, and just use _HAS_CXX17 && defined(__cpp_explicit_this_parameter) to enable these changes.

@frederick-vs-ja
A. Jiang (frederick-vs-ja) requested a review from a team as a code owner July 29, 2022 08:17
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the LWG Library Working Group issue label Jul 29, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Note that __cpp_explicit_this_parameter wasn't defined because the feature doesn't work with modules yet.

Comment thread tests/std/tests/P0433R2_deduction_guides/test.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typo in tests, but otherwise LGTM!

@strega-nil-ms nicole mazzuca (strega-nil-ms) removed their assignment Jul 29, 2022
Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
Comment thread tests/std/tests/P0433R2_deduction_guides/test.cpp
Comment thread stl/inc/type_traits
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks, this looks great! I never imagined that the deduction guide machinery would be extended in this way, but it works quite elegantly 😻

I've pushed a couple of small extensions to the tests (FYI nicole mazzuca (@strega-nil-ms) after you approved).

@StephanTLavavej

Copy link
Copy Markdown
Member

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

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 4677bae into microsoft:main Aug 5, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for updating the library to keep up with the compiler's Future Technology! 🤖 🚀 😸

@frederick-vs-ja
A. Jiang (frederick-vs-ja) deleted the lwg-3617 branch August 5, 2022 23:58
nicole mazzuca (strega-nil) pushed a commit to strega-nil/stl that referenced this pull request Aug 6, 2022
…educing `this` (microsoft#2966)

Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Igor Zhukov (fsb4000) pushed a commit to fsb4000/STL that referenced this pull request Aug 13, 2022
…educing `this` (microsoft#2966)

Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LWG Library Working Group issue

3 participants