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

LWG-3117 Missing packaged_task deduction guides #1493

Conversation

futuarmo
Copy link
Contributor

@futuarmo futuarmo commented Nov 21, 2020

LWG-3117 Missing packaged_task deduction guides

I've got deduction guides from function, because there are similar requirements for packaged_task deduction guides. All tests are passed

Fixes #1465

@futuarmo futuarmo requested a review from a team as a code owner November 21, 2020 16:42
stl/inc/future Outdated Show resolved Hide resolved
stl/inc/future Show resolved Hide resolved
@StephanTLavavej StephanTLavavej added the LWG Library Working Group issue label Nov 24, 2020
@StephanTLavavej
Copy link
Member

Thanks for the CTAD upgrade! I pushed a couple of changes:

  1. Rename the macro being used to stamp out the packaged_task deduction guides for different calling conventions, so it's not the same as the macro being used for function. This makes it easier to search the codebase, even though there was no actual conflict (because we immediately #undef the macros).

  2. Add test coverage. Since we already had good test coverage for function, I simply templatized it. The only extra work necessary (aside from guarding this against /clr and /clr:pure) was that function is copyable while packaged_task is movable-only. I used if constexpr to test copy construction when available for function, and move construction always.

@StephanTLavavej StephanTLavavej merged commit 82bb1bf into microsoft:master Dec 3, 2020
@StephanTLavavej
Copy link
Member

Thanks for making packaged_task easier to use! 📦 🐈 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LWG Library Working Group issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LWG-3117 Missing packaged_task deduction guides
4 participants