-
Notifications
You must be signed in to change notification settings - Fork 231
Open
Description
I am not sure if this is an issue that should be fixed
For the following code, im not including <exec/start_detached.hpp> for calling exec::start_detached:
#include <stdexec/execution.hpp>
// missing include file
// #include <exec/start_detached.hpp>
void do_some_work() {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
int main() {
auto work = stdexec::just() | stdexec::then([] {
do_some_work();
});
exec::start_detached(std::move(work));
std::this_thread::sleep_for(std::chrono::seconds(1));
return 0;
}and the compiler gives error:
-> % g++ ./include-issue.cpp -I/some/random/path/stdexec/include -std=c++20 -ltbb
./include-issue.cpp: In function ‘int main()’:
./include-issue.cpp:14:25: error: no match for call to ‘(const experimental::execution::start_detached_t) (std::remove_reference<stdexec::{anonymous}::__sexpr<<lambda closure object>stdexec::<lambda()>()>&>::type)’
14 | exec::start_detached(std::move(work));
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
- it's a bit misleading the compiler reporting "no match call" instead of "not defined", there might be a forward declarations seen by compiler
- given that im only including files under
stdexec, seeing forward declarations fromexecmight not be an expected behavior?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels