Skip to content

[WIP] mandate that a unhandled_stopped be noexcept #359

@ericniebler

Description

@ericniebler

in [exec.as.awaitable], the concept awaitable-sender is true for senders that can be adapted into awaitables. it is specified as:


template<class Sndr, class Promise>
  concept awaitable-sender =
    single-sender<Sndr, env_of_t<Promise>> &&
    sender-to<Sndr,
              typename sender-awaitable<Sndr, Promise>::awaitable-receiver> &&    // see below
    requires (Promise& p) {
      { p.unhandled_stopped() } -> convertible_to<coroutine_handle<>>;
    };

this says a sender can only be awaitable if the promise type provides an unhandled_stopped() member function that returns a coroutine_handle.

it does not require or mandate that unhandled_stopped() be noexcept.

since it is likely to be only called from a receiver's set_stopped member function (which is required to be noexcept), there is nothing to be done with an exception thrown from unhandled_stopped() except terminate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions