STL icon indicating copy to clipboard operation
STL copied to clipboard

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

Open fsb4000 opened this issue 6 years ago • 5 comments

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.

fsb4000 avatar Nov 20 '19 14:11 fsb4000

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.

StephanTLavavej avatar Nov 21 '19 04:11 StephanTLavavej

Thank you.

fsb4000 avatar Nov 21 '19 05:11 fsb4000

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

Curve avatar Jul 28 '24 19:07 Curve

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.

StephanTLavavej avatar Jul 28 '24 19:07 StephanTLavavej

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

frederick-vs-ja avatar Sep 10 '24 05:09 frederick-vs-ja