MetaImGUI 1.0.0
ImGui Application Template for C++20
Loading...
Searching...
No Matches
MetaImGUI::Task Struct Reference

Eager fire-and-forget coroutine return type. More...

#include <Coroutine.h>

Classes

struct  promise_type
 

Detailed Description

Eager fire-and-forget coroutine return type.

Both initial and final suspend return suspend_never, so:

  • the coroutine starts immediately on call,
  • the coroutine frame is destroyed automatically when the body returns.

Use this for "kick off an async UI flow and forget" — e.g. a dialog sequence that drives itself via co_await on UI events. Exceptions that escape the body terminate; coroutines on the UI thread should not throw.

Lifetime contract: any awaiter inside the coroutine must keep the data it captures alive at least until it resumes the handle. The coroutine frame holds the awaiter, so capturing this on a stack-resident awaiter is safe.

Definition at line 42 of file Coroutine.h.


The documentation for this struct was generated from the following file: