Y
Hacker News
new
|
ask
|
show
|
jobs
by
stargrazer
1654 days ago
Can you point to better alternate ways or idioms?
3 comments
MauranKilom
1654 days ago
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...
link
MontagFTB
1654 days ago
stlab has a task type that works around a couple of these issues:
https://stlab.cc/libraries/concurrency/task/task/
link
jjtheblunt
1654 days ago
(joke) : Common Lisp
link
Example: https://github.com/facebook/folly/blob/main/folly/docs/Funct...