Commit 9dae32de authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

reexport remaining coroutine names

Summary: Reexport remaining names, including `noop_coroutine`, from `folly/experimental/coro/Coroutine.h`, which wraps inclusion of `experimental/coroutine`.

Differential Revision: D26227580

fbshipit-source-id: b7ea0bb0bb7447bf4327b2f178c51db544f70f46
parent 99a218de
......@@ -29,6 +29,10 @@
namespace folly::coro {
using std::experimental::coroutine_handle;
using std::experimental::coroutine_traits;
using std::experimental::noop_coroutine;
using std::experimental::noop_coroutine_handle;
using std::experimental::noop_coroutine_promise;
using std::experimental::suspend_always;
using std::experimental::suspend_never;
......
......@@ -63,12 +63,11 @@ struct await_suspend_return_coroutine_fn {
coroutine_handle<> operator()(A& a, coroutine_handle<P> coro) const
noexcept(noexcept(a.await_suspend(coro))) {
using result = decltype(a.await_suspend(coro));
auto noop = std::experimental::noop_coroutine();
if constexpr (std::is_same_v<void, result>) {
a.await_suspend(coro);
return noop;
return noop_coroutine();
} else if constexpr (std::is_same_v<bool, result>) {
return a.await_suspend(coro) ? noop : coro;
return a.await_suspend(coro) ? noop_coroutine() : coro;
} else {
return a.await_suspend(coro);
}
......
......@@ -80,7 +80,7 @@ class Barrier {
}
return std::exchange(continuation_, {});
} else {
return std::experimental::noop_coroutine();
return noop_coroutine();
}
}
......@@ -95,12 +95,12 @@ class Barrier {
auto coro = std::exchange(continuation_, {});
if (asyncFrame_ != nullptr) {
folly::resumeCoroutineWithNewAsyncStackRoot(coro, *asyncFrame_);
return std::experimental::noop_coroutine();
return noop_coroutine();
} else {
return coro;
}
} else {
return std::experimental::noop_coroutine();
return noop_coroutine();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment