2#include <asyncpp/detail/concepts.h>
15 template<Dispatcher TDispatcher>
43 noexcept(
noexcept(
target_dispatcher->push(std::declval<std::function<
void()>>()))) {
Provides a consistent import interface for coroutine, experimental/coroutine or a best effort fallbac...
Defer the current coroutine to a different dispatcher context.
Definition defer.h:16
constexpr bool await_ready() const noexcept
Check if await should suspend.
Definition defer.h:37
void await_suspend(coroutine_handle<> hndl) const noexcept(noexcept(target_dispatcher->push(std::declval< std::function< void()> >())))
Suspend the current coroutine and schedule resumption on the specified dispatcher.
Definition defer.h:42
constexpr defer(TDispatcher &target) noexcept
Construct with a reference to a dispatcher.
Definition defer.h:31
TDispatcher * target_dispatcher
The new dispatcher to resume execution on.
Definition defer.h:18
constexpr void await_resume() const noexcept
Called on resumption.
Definition defer.h:47
constexpr defer(TDispatcher *target) noexcept
Construct with a pointer to a dispatcher.
Definition defer.h:25