Hacker News new | ask | show | jobs
by stargrazer 1654 days ago
Can you point to better alternate ways or idioms?
3 comments

It's possible to write something like `std::unique_function` (which uniquely owns the stored callable and can be moved but not copied). That's often preferable for storing functors.

Example: https://github.com/facebook/folly/blob/main/folly/docs/Funct...

stlab has a task type that works around a couple of these issues: https://stlab.cc/libraries/concurrency/task/task/
(joke) : Common Lisp