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

connect(let_value) is not constrained enough #630

Open
glebov-andrey opened this issue Aug 28, 2024 · 0 comments
Open

connect(let_value) is not constrained enough #630

glebov-andrey opened this issue Aug 28, 2024 · 0 comments

Comments

@glebov-andrey
Copy link

Hi,

There appears to be an issue with let_value wrapping single-shot (move only) senders, when the resulting sender is passed to spawn_detached.

The following code doesn't compile:

unifex::any_sender_of<> s = unifex::just();
auto a1 = std::move(s) | unifex::let_value([]() { return unifex::just(); });
auto scope = unifex::v2::async_scope{};
unifex::spawn_detached(std::move(a1), scope);

As far as I understand, the problem is that let_value's connect function is not constrained on sender_to<member_t<Sender, Predecessor>, predecessor_receiver<...>>.
So when async_scope checks requires sender_to<const Sender&, remove_cvref_t<Receiver>> it tries to instantiate let_value's connect which of course fails inside operation on connect_result_t<const Sender &, predecessor_receiver>.

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