Skip to content

BG060 09.04.4 Fix names of Promise functions #59

@wg21bot

Description

@wg21bot

(BG-local 6)

Most of the Promise function names are worded as observer functions, yet none of them are!
Example: unhandled_exception reads exactly the same as uncaught_exception(s), already in the standard library!
This will create confusion in people learning the API, as the same naming style is reused with a different meaning.

Proposed change:
Mark functions, which are user implementations of required behavior, with an "on_" prefix. unhanded_exception becomes on_unhanded_exception, return_value becomes, on_return_value, return_void becomes on_return_void, yield_value becomes on_yield_value.
This naming might seem novel, but the API itself is quite different from the rest of the Standard Library already. The fact that, for example, yield_value does not actually return the yielded value, the way std::begin does, is already a stark enough contrast that calls for different naming.
Note: await_transform is a special, optional case and should be let as it is, unless the Committee decides otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EWGEvolutioncoroutinesCoroutinesrejectedNo consensus for a change.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions