Open ericniebler opened 11 months ago
@ericniebler @lewissbaker @kirkshoop am I correct to assume that this is addressed in: https://isocpp.org/files/papers/P3325R0.html#by-value-vs.-by-reference
If not, there's a section in the roadmap - "Generalised Environment/Queryable Facilities (P3121)" under which there's "Enumerating queries" section addressing the Env
lifetime, so in any case, I'm marking this as P0.
@ericniebler @lewissbaker @kirkshoop am I correct to assume that this is addressed in: https://isocpp.org/files/papers/P3325R0.html#by-value-vs.-by-reference
This issue is not addressed by P3325.
The linked section of P3325 is referring to whether or not the env
object itself should capture by reference or by value.
This issue is more about being able to take a sender's attributes and copy them and whether or not the copies should be valid after the sender itself is destroyed. i.e. can you take an independent copy of a sender's attributes?
If not, there's a section in the roadmap - "Generalised Environment/Queryable Facilities (P3121)" under which there's "Enumerating queries" section addressing the
Env
lifetime, so in any case, I'm marking this as P0.
Yes, the suggestion is that having the ability to enumerate the queries means that you can then construct an algorithm that can construct a new environment that contains copies of all of the query values. So I think it needs something like the generalised environment/queryable facility.
See #191 for the generalised environment work.
Facilities/issues not described in P3325R0 which will require a followup paper:
Issue by ericniebler Monday Feb 13, 2023 at 16:22 GMT Originally opened as https://github.com/NVIDIA/stdexec/issues/764
It's clear that a receiver's environment should have reference semantics. But is that also true for a sender's? Might it not be sometimes desirable to copy a sender's environment into the operation state, letting go of the sender itself?
If so, a sender's environment needs value semantics, or else a way to "deep copy" the environment. The latter could be as simple as a way of enumerating the queries that an environment supports, which could be useful elsewhere as well; e.g., it could be useful in a facility that generates type-erased wrappers for queryables.