Skip to content

"What the Compiler Transforms" section still shows a coroutine #113

@alandefreitas

Description

@alandefreitas

I've been reading through docs, and
https://develop.capy.cpp.al/capy/cpp20-coroutines/syntax.html has a "What the Compiler Transforms" section
that promises to show "how the compiler transforms a coroutine into a regular function".

The problem is the code example still uses coroutine keywords, which makes it confusing. I think what the example is actually doing is showing what the coroutine would look like if the promise implicit steps were made explicit.

This section could be improved by clarifying the intent, showing the actual transformation, or a two-step explanation. I would suggest a two-step explanation because this is not a good section to explain these implicit steps (the docs say promises will be explained later), and because
the actual transformation without the implicit steps would be hard to understand. The actual transformation would probably be a resumable functor rather than a function, though.

The rest of the "Introduction To C++20 Coroutines" looks great, though. The section hierarchy is really good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions