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

<future>: packaged_task can't be constructed from a move-only lambda #321

Closed
fsb4000 opened this issue Nov 20, 2019 · 5 comments · Fixed by #4946
Closed

<future>: packaged_task can't be constructed from a move-only lambda #321

fsb4000 opened this issue Nov 20, 2019 · 5 comments · Fixed by #4946
Labels
bug Something isn't working fixed Something works now, yay!

Comments

@fsb4000
Copy link
Contributor

fsb4000 commented Nov 20, 2019

Describe the bug
Can't create std::packaged_task with lambda.

I receive compilation error:

call to implicitly-deleted copy constructor of '(lambda at main.cpp)'

Command-line test case
STL version (git commit or Visual Studio version): Visual Studio 2019 16.3.9

https://godbolt.org/z/2CysfN

Expected behavior
Should work like gcc linux/clang linux or mingw64-gcc and mingw64-clang

vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.

@StephanTLavavej StephanTLavavej added bug Something isn't working vNext Breaks binary compatibility labels Nov 21, 2019
@StephanTLavavej StephanTLavavej changed the title Use lambda copy constuctor instead lambda move constructor <future>: packaged_task can't be constructed from a move-only lambda Nov 21, 2019
@StephanTLavavej
Copy link
Member

Thanks for reporting this bug. It's a known issue that we've developed a fix for - however, the fix inherently breaks binary compatibility, so it will need to be applied to our "vNext" branch.

@fsb4000
Copy link
Contributor Author

fsb4000 commented Nov 21, 2019

Thank you.

@Curve
Copy link

Curve commented Jul 28, 2024

Is there any progress in this manner? This is quite the deal breaker when using std::move_only_function with std::packaged_task

@StephanTLavavej
Copy link
Member

We cannot make progress on this issue until we're allowed to break binary compatibility (we maintainers really want to, but we need to get management approval first). There is no ETA for such a "vNext" release at this time.

@frederick-vs-ja
Copy link
Contributor

I think this can be fixed in an ABI-preserving way like #2568.

@StephanTLavavej StephanTLavavej added fixed Something works now, yay! and removed vNext Breaks binary compatibility labels Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Something works now, yay!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants