You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current specification of std::execution::get_env() defines get_env(o) as as_const(o).get_env().
However, the as_const() function has a deleted rvalue-taking overload, meaning that you cannot pass temporaries to it.
This means that several uses of get_env() which pass expressions with are either potentially rvalues (e.g. in definition of connect(sndr, rcvr) it uses the expression get_env(rcvr), but rcvr could be, and usually is, a prvalue) or always rvalues (e.g. scheduler concept has the expression get_env(schedule(std::forward<Sch>(sch)))).
The intent here was that get_env() is a function that takes as an argument a const T& and thus allows prvalues to bind to it. We basically just want to require that get_env() finds a const-qualified member-function. The use of as_const() does not seem to mirror the semantics of a function with a const T& parameter, so I suggest we change it to something else.
Maybe an exposition-only AS-CONST(expr) that is equivalent to []<class T>(const T& x) noexcept -> const T& { return x; }(expr)?
The text was updated successfully, but these errors were encountered:
The current specification of
std::execution::get_env()
definesget_env(o)
asas_const(o).get_env()
.However, the
as_const()
function has a deleted rvalue-taking overload, meaning that you cannot pass temporaries to it.This means that several uses of
get_env()
which pass expressions with are either potentially rvalues (e.g. in definition ofconnect(sndr, rcvr)
it uses the expressionget_env(rcvr)
, butrcvr
could be, and usually is, a prvalue) or always rvalues (e.g.scheduler
concept has the expressionget_env(schedule(std::forward<Sch>(sch)))
).The intent here was that
get_env()
is a function that takes as an argument aconst T&
and thus allows prvalues to bind to it. We basically just want to require thatget_env()
finds a const-qualified member-function. The use ofas_const()
does not seem to mirror the semantics of a function with aconst T&
parameter, so I suggest we change it to something else.Maybe an exposition-only
AS-CONST(expr)
that is equivalent to[]<class T>(const T& x) noexcept -> const T& { return x; }(expr)
?The text was updated successfully, but these errors were encountered: