NVIDIA / stdexec

`std::execution`, the proposed C++ framework for asynchronous and parallel programming.
Apache License 2.0
1.56k stars 159 forks source link

Should all receivers be moved into the completion signals? #422

Closed msimberg closed 9 months ago

msimberg commented 2 years ago

I don't know if this makes any difference in the wording, but there's currently quite a mix of how receivers are passed into completion signals:

Should they all just be std::moved? Or something else? I'll happily attempt to clean this up (including #379).

ericniebler commented 2 years ago

The answer depends. When the algorithms mention out_r, what they should be saying is that they are manipulating an rvalue (or xvalue to be more precise) that refers to a copy of out_r that lives in <place>. ("<place>" most likely is within the operation state.) If for the sake of the specification, you give that rvalue a name like out_r', then out_r' can appear in a set_[value|error|stopped] expression without a cast or a move, because it is already an rvalue.

Also see #403.

ericniebler commented 2 years ago

I'll happily attempt to clean this up (including #379).

Oh, and in case it wasn't clear ... YES PLEASE. :-) #403 also, while you're at it.