facebookexperimental / facebookexperimental/libunifex
any_sender_of<> did not support stop_when sender
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 210
- PR merge metrics
- No merged PRs in 30d
Description
set_value cause template argument deduction/substitution failing
```C++
#include
#include
#include
#include
#include
#include
int main() {
using AnySender = unifex::any_sender_of<>;
// Simulate the handler returning AnySender
auto handler_sender = AnySender{unifex::just()};
// Timeout duration
std::chrono::seconds timeout(5);
// This line causes compilation failure:
// The issue is that schedule_after requires a scheduler context,
// but we're trying to use it directly without a scheduler instance
auto timeout_sender = std::move(handler_sender)
| unifex::stop_when(unifex::schedule_after(timeout));
/*
auto timeout_sender = std::move(handler_sender) // Success
*/
// Further processing with let_done
auto result_sender = std::move(timeout_sender)
| unifex::let_done([]() {
return AnySender{unifex::just()};
});
// Convert back to AnySender
AnySender final_result{std::move(result_sender)};
return 0;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.