Get the latest tech news
Show HN: Coros – A Modern C++ Library for Task Parallelism
An easy-to-use and fast library for task-based parallelism, utilizing coroutines. - mtmucha/coros
This requirement ensures that return values can be constructed from an r-value reference, utilizing either a move or a copy constructor. Best practice is passing values and references through coroutine parameters rather than captures to ensure safety and avoid unexpected behavior. All these functions are constrained to only accept r-value references because the tasks are enqueued and not awaited, which means their coros::Task<T> objects are temporary(destroyed when finished) and cannot be used to retrieve values.
Or read this on Hacker News