Improve folly::coro::Task<T> support for move-only types
Summary: The folly::coro::Task<T> and folly::coro::Future<T> types would previously return an lvalue-reference to the result when you co_await them. This means that for move-only types that code like `auto x = co_await someTask;` would fail to compile. Instead you would need to write `auto x = std::move(co_await someTask);`. Awaiting a Task<T> or Future<T> now returns type T instead of T&. As part of this change we now only allow co_awaiting an rvalue folly::coro::Task<T>, folly::coro::Future<T> as well as folly::coro::Future<T> to indicate that the operation is destructive and a one-time operation. Reviewed By: andriigrynenko Differential Revision: D9731525 fbshipit-source-id: bee9e633b57b203a0d048cf3eb0e2fc48b899481
Showing
Please register or sign in to comment