facebookexperimental / facebookexperimental/libunifex
Combination of submit and let_with causes compilation errors on MSVC
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 210
- PR merge metrics
- No merged PRs in 30d
Description
I suppose that this is a compiler bug, but just in case:
```
struct dummy_receiver {
void set_value() && noexcept {}
void set_error(std::exception_ptr) && noexcept {}
void set_done() && noexcept {}
};
...
submit(
let_with(
[]() noexcept { return 1; },
[&](auto &) {
return when_all(
transform(schedule(inline_scheduler()), [=]() noexcept {})
);
}),
dummy_receiver{}
);
```
This code won't compile on MSVC unless I remove the trailing return type [here](https://github.com/facebookexperimental/libunifex/blob/2efda8062a4ced795bfbe0ffb670904be2baffbd/include/unifex/when_all.hpp#L313), but in this case it will leak a memory (not de-allocating _submit::operation)
Contributor guide
Assessment
This issue has not been assessed yet.