Open
Description
The definitions of MAKE-ENV
, JOIN-ENV
, and FWD-ENV
make them context-dependent; the pseudo-macros can expand to different expressions for the same arguments in different usage contexts. That's fine, but we don't discuss when one execution environment can be substituted with another in an equality-preserving way.
Functionally, any two environments are "equal" if they support the same queries with the same types and values. The type of the environment itself is immaterial; only the query expressions matter.
Proposed Resolution
Change [exec.query.general] as follows:
33.2.1 General [exec.queryable.general] - 1. A queryable object is a read-only collection of key/value pair where each key is a customization point object known as a query object. A query is an invocation of a query object with a queryable object as its first argument and a (possibly empty) set of additional arguments. A query imposes syntactic and semantic requirements on its invocations. - 2. Let q be a query object, let args be a (possibly empty) pack of subexpressions, let env be a subexpression that refers to a queryable object o of type O, and let cenv be a subexpression referring to o such that decltype((cenv)) is const O&. The expression q(env, args...) is equal to ([concepts.equality]) the expression q(cenv, args...). - 3. The type of a query expression cannot be void. - 4. The expression q(env, args...) is equality-preserving ([concepts.equality]) and does not modify the query object or the arguments. +- ?. The type of a queryable object is a queryable type. Let A and B be two + queryable types. A and B are considered equivalent if, given two objects + a and b of types A and B respectively and any query object q, either + both expressions a.query(q) and b.query(q) are ill-formed, or else they + are both well-formed and have the same type. Objects a and b are equal + ([concepts.equality]) if queryable types A and B are equivalent and if + for any query object q the expressions a.query(q) and b.query(q) yield the + same value if they are well-formed. - 5. If the expression env.query(q, args...) is well-formed, then it is expression-equivalent to q(env, args...). - 6. Unless otherwise specified, the result of a query is valid as long as the queryable object is valid.
In [exec.getcomplsigs], insert a new paragraph between paragraphs 2 and 3 that
reads:
+- ?. Let Env1 and Env2 be two equivalent queryable types ([exec.query.general]), + and let Sndr be a sender type. If completion_signatures_of_t<Sndr, Env1> + satisfies valid-completion-signatures, then completion_signatures_of_t<Sndr, Env2> + shall denote the same type, and vice versa.