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
Lifetime of receivers returned by operator | #248
Comments
The problem is that you need to have a reference to the full processing graph somewhere. If you do not assign the result of In C++17 we could add the |
I run into the problem at the beginning as well. But after I stepped once into this trap, it never happened to me again. |
@FelixPetriconi Is it possible to add a |
I started looking into this, but it is not as simple as for the futures, because currently one cannot attach a so called process (e.g. a lambda) with no arguments to a receiver. So |
@FelixPetriconi It might also be worth thinking about adding a |
It might also be worth making some of the channel interfaces more like the future interfaces which can handle ranges. template <typename M, typename S, typename F, typename... R>
auto merge_channel(S s, F f, R... upstream_receiver) {} should have another interface like template <typename M, typename S, typename F, typename I>
auto merge_channel(S s, F f, std::pair<I, I> range) {} same is true for |
You are true, this is missing. New issue created: #257 |
Fixed in 1.5.0 |
The title is probably not very explicit, hopefully the following snippet explains a bit better:
This code is looping forever, because the process that set
done
is never called. The reason is a missingauto hold =
in:It took me a while to figure that out. Shouldn't the channel take ownership of the intermediate receivers or something like that? It's probably not possible since they may have different types... I wish an error would be triggered for this kind of coding mistake.
The text was updated successfully, but these errors were encountered: