-
Notifications
You must be signed in to change notification settings - Fork 208
Open
Description
set_value cause template argument deduction/substitution failing
#include <unifex/any_sender_of.hpp>
#include <unifex/just.hpp>
#include <unifex/let_done.hpp>
#include <unifex/stop_when.hpp>
#include <chrono>
#include <memory>
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;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels