Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 1.5.1 "then" doesn't seem to work. #301

Open
aaron-michaux opened this issue Oct 31, 2024 · 2 comments
Open

Example 1.5.1 "then" doesn't seem to work. #301

aaron-michaux opened this issue Oct 31, 2024 · 2 comments

Comments

@aaron-michaux
Copy link

aaron-michaux commented Oct 31, 2024

I believe that I've identified two issues with the examples.

  • The completion signatures on the _then_sender fail when the function returns void. (error: invalid parameter type 'std::__success_type<void>::type' {aka 'void'}) Some guidance needs to be given on how to handle void return types!
  • The _then_receiver relies on base() being a member of the parent class receiver; however, base() isn't part of the specification anywhere. Would it be plausible to have the example static_cast<R&&>(std::move(*this)), or is that somehow wrong. If so, the example needs further exposition on what the example is doing.
@aaron-michaux
Copy link
Author

aaron-michaux commented Oct 31, 2024

The example also fails if the function must take an input value.

Trying to figure this out from compiler messages and reading the stdexec code is almost impossible.

For example, I cannot copy code from __then.hpp into a new file, and attempt to progressively refactor it in order to understand what all the parts do. (The variable names aren't great... the compiler errors unhelpful.)

I think it's important that we have at least a minimal working example that shows how you'd write a then sender.

In particular, P2300r10 says that "it's a challenge" to write the completion signatures for a sender. No kidding. An example is with 1000 pages of standardize. How do I write the completion signatures?

@aaron-michaux
Copy link
Author

For anyone who finds this issue, Maikel Nadolski offers a "naive solution" here. It's for exposition only.

https://godbolt.org/z/5qczb9dhh

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

No branches or pull requests

1 participant