2
0
mirror of https://github.com/boostorg/cobalt.git synced 2026-01-19 04:02:16 +00:00
Files
cobalt/doc/design/promise.adoc
Klemens Morgenstern 45901641ac renamed to cobalt.
2023-10-16 21:42:07 +08:00

19 lines
379 B
Plaintext

[#design:promise]
== Promise
The main coroutine type is a `promise`, which is eager.
The reason to default to this, is that the compiler can optimize out
promises that do not suspend, like this:
[source,cpp]
----
cobalt::promise<void> noop()
{
co_return;
}
----
Awaiting the above operation is in theory a noop,
but practically speaking, compilers aren't there as of 2023.