D++ (DPP)
C++ Discord API Bot Library
|
Base type for a coroutine, starts on co_await. More...
#include <coro/coroutine.h>
Public Member Functions | |
coroutine ()=default | |
Default constructor, creates an empty coroutine. More... | |
coroutine (const coroutine &)=delete | |
Copy constructor is disabled. More... | |
coroutine (coroutine &&other) noexcept | |
Move constructor, grabs another coroutine's handle. More... | |
~coroutine () | |
Destructor, destroys the handle. More... | |
coroutine & | operator= (const coroutine &)=delete |
Copy assignment is disabled. More... | |
coroutine & | operator= (coroutine &&other) noexcept |
Move assignment, grabs another coroutine's handle. More... | |
bool | await_ready () const |
First function called by the standard library when the coroutine is co_await-ed. More... | |
auto & | operator co_await () &noexcept |
Suspend the caller until the coroutine completes. More... | |
const auto & | operator co_await () const &noexcept |
Suspend the caller until the coroutine completes. More... | |
auto && | operator co_await () &&noexcept |
Suspend the caller until the coroutine completes. More... | |
Friends | |
class | detail::coroutine::coroutine_base< R > |
Internal use only base class containing common logic between coroutine<R> and coroutine<void>. It also serves to prevent await_suspend and await_resume from being used directly. More... | |
Base type for a coroutine, starts on co_await.
R | Return type of the coroutine. Can be void, or a complete object that supports move construction and move assignment. |
|
default |
Default constructor, creates an empty coroutine.
|
delete |
Copy constructor is disabled.
|
noexcept |
Move constructor, grabs another coroutine's handle.
other | Coroutine to move the handle from |
dpp::coroutine< R >::~coroutine | ( | ) |
Destructor, destroys the handle.
bool dpp::coroutine< R >::await_ready | ( | ) | const |
First function called by the standard library when the coroutine is co_await-ed.
invalid_operation_exception | if the coroutine is empty or finished. |
|
inlinenoexcept |
Suspend the caller until the coroutine completes.
On | resumption, any exception thrown by the coroutine is propagated to the caller. |
|
inlinenoexcept |
Suspend the caller until the coroutine completes.
On | resumption, any exception thrown by the coroutine is propagated to the caller. |
|
inlinenoexcept |
Suspend the caller until the coroutine completes.
On | resumption, any exception thrown by the coroutine is propagated to the caller. |
|
delete |
Copy assignment is disabled.
|
noexcept |
Move assignment, grabs another coroutine's handle.
other | Coroutine to move the handle from |
|
friend |
Internal use only base class containing common logic between coroutine<R> and coroutine<void>. It also serves to prevent await_suspend and await_resume from being used directly.