33 Execution control library [exec]

33.9 Senders [exec.snd]

33.9.12 Sender adaptors [exec.adapt]

33.9.12.3 execution​::​write_env [exec.write.env]

write_env is a sender adaptor that accepts a sender and a queryable object, and that returns a sender that, when connected with a receiver rcvr, connects the adapted sender with a receiver whose execution environment is the result of joining the queryable object to the result of get_env(rcvr).
write_env is a customization point object.
For some subexpressions sndr and env, if decltype((sndr)) does not satisfy sender or if decltype((env)) does not satisfy queryable, the expression write_env(sndr, env) is ill-formed.
Otherwise, it is expression-equivalent to make-sender(write_env, env, sndr).
Let write-env-t denote the type decltype(auto(write_env)).
The exposition-only class template impls-for ([exec.snd.general]) is specialized for write-env-t as follows: template<> struct impls-for<write-env-t> : default-impls { static constexpr auto join-env(const auto& state, const auto& env) noexcept { return see below; } static constexpr auto get-env = [](auto, const auto& state, const auto& rcvr) noexcept { return join-env(state, FWD-ENV(get_env(rcvr))); }; template<class Sndr, class... Env> static consteval void check-types(); };
Invocation of impls-for<write-env-t>​::​join-env returns an object e such that
  • decltype(e) models queryable and
  • given a query object q, the expression e.query(q) is expression-equivalent to state.query(q) if that expression is valid, otherwise, e.query(q) is expression-equivalent to env.query(q).
  • For a type Sndr and a pack of types Env, let State be data-type<Sndr> and let JoinEnv be the pack decltype(join-env(declval<State>(), FWD-ENV(declval<Env>()))).
    Then impls-for<write-
    env-t
    >​::​check-types<Sndr, Env...>()
    is expression-equivalent to get_completion_signatures<
    child-type<Sndr>, JoinEnv...>()
    .