<future>: Make packaged_task accept move-only functors by frederick-vs-ja · Pull Request #4946 · microsoft/STL (original) (raw)

Fixes #321.

The issue was considered ABI-breaking, but I think it can be resolved in an ABI-preserving way like #2568. This PR adds internal constructors to function to accept non-copy-constructible functors and add static_assert to keep the copyability checking for standard constructors. Valid user codes won't be able to call these internal constructors.

Also implements the previously missing Mandates in [futures.task.members]/3, and switches to use move construction in reset per [futures.task.members]/26.

Notes: