-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Since `Baton` doesn't currently support `co_awaitTry`, I found myself writing this sort of thing in my "coro/safe" implementation: ``` Try<ResultT> res; if constexpr (std::is_same_v< decltype(inner), ::folly::coro::Baton::WaitOperation>) { co_await std::move(t); } else { res = co_await co_awaitTry(std::move(t)); } ``` After this diff, the above could be abbreviated to: ``` auto res = co_await co_awaitTry(std::move(t)); ``` Since awaiting `Baton` doesn't throw, I see no downside to supporting `co_awaitTry` here, besides the minor header bloat. Reviewed By: andriigrynenko Differential Revision: D64274928 fbshipit-source-id: 201f8b0765f19a769bd80b34ff4c86792c5b6df4
- Loading branch information
1 parent
f661bfb
commit 6c0b1ec
Showing
3 changed files
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters