Skip to content

added a proposed resolution for issue 4347#549

Open
dietmarkuehl wants to merge 5 commits intocplusplus:masterfrom
dietmarkuehl:issue4347-wording
Open

added a proposed resolution for issue 4347#549
dietmarkuehl wants to merge 5 commits intocplusplus:masterfrom
dietmarkuehl:issue4347-wording

Conversation

@dietmarkuehl
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings February 22, 2026 00:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a proposed resolution for issue 4347, which involves restructuring the stop token management in C++ execution's task class template. The resolution moves the stop_source_type and stop_token_type members from the promise_type class to the state class, and introduces a new exposition-only function get-stop-token() to manage stop token initialization more appropriately.

Changes:

  • Adds an optional<stop_source_type> member and get-stop-token() function to the task::state class
  • Modifies the start() method specification and adds the new get-stop-token() method specification in [task.state]
  • Removes token and source members from promise_type in [task.promise]
  • Updates get_env() specification to use STATE(*this).get-stop-token() instead of token

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

dietmarkuehl and others added 2 commits February 22, 2026 10:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dietmarkuehl
Copy link
Collaborator Author

OK. I try to phrase it differently. I don’ really have a Returns: clause but the last paragraph does look somewhat like it.

The logic (for type erasing the stop token type) is:

if constexpr (<receiver’s stop token type matches>)
    return <receiver’s stop token>;
else {
    if (_source_.initialized)
        initialize _source_;
    return _source_->get_token();
}

The source shouldn’t exist if the type from the receiver matches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants