From Jason Turner

[exec.write.env]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp9abp7fww/{from.md → to.md} +50 -0
tmp/tmp9abp7fww/{from.md → to.md} RENAMED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### `execution::write_env` <a id="exec.write.env">[[exec.write.env]]</a>
2
+
3
+ `write_env` is a sender adaptor that accepts a sender and a queryable
4
+ object, and that returns a sender that, when connected with a receiver
5
+ `rcvr`, connects the adapted sender with a receiver whose execution
6
+ environment is the result of joining the `queryable` object to the
7
+ result of `get_env(rcvr)`.
8
+
9
+ `write_env` is a customization point object. For some subexpressions
10
+ `sndr` and `env`, if `decltype((sndr))` does not satisfy `sender` or if
11
+ `decltype((env))` does not satisfy `queryable`, the expression
12
+ `write_env(sndr, env)` is ill-formed. Otherwise, it is
13
+ expression-equivalent to `make-sender(write_env, env, sndr)`.
14
+
15
+ Let *`write-env-t`* denote the type `decltype(auto(write_env))`. The
16
+ exposition-only class template *`impls-for`* [[exec.snd.expos]] is
17
+ specialized for *`write-env-t`* as follows:
18
+
19
+ ``` cpp
20
+ template<>
21
+ struct impls-for<write-env-t> : default-impls {
22
+ static constexpr auto join-env(const auto& state, const auto& env) noexcept {
23
+ return see below;
24
+ }
25
+
26
+ static constexpr auto get-env =
27
+ [](auto, const auto& state, const auto& rcvr) noexcept {
28
+ return join-env(state, FWD-ENV(get_env(rcvr)));
29
+ };
30
+
31
+ template<class Sndr, class... Env>
32
+ static consteval void check-types();
33
+ };
34
+ ```
35
+
36
+ Invocation of `impls-for<write-env-t>::join-env` returns an object `e`
37
+ such that
38
+
39
+ - `decltype(e)` models `queryable` and
40
+ - given a query object `q`, the expression `e.query(q)` is
41
+ expression-equivalent to `state.query(q)` if that expression is valid,
42
+ otherwise, `e.query(q)` is expression-equivalent to `env.query(q)`.
43
+
44
+ For a type `Sndr` and a pack of types `Env`, let `State` be
45
+ `data-type<Sndr>` and let `JoinEnv` be the pack
46
+ `decltype(join-env(declval<State>(), FWD-ENV(declval<Env>())))`. Then
47
+ `impls-for<write-env-{t}>::check-types<Sndr, Env...>()` is
48
+ expression-equivalent to
49
+ `get_completion_signatures<child-{type}<Sndr>, JoinEnv...>()`.
50
+