From Jason Turner

[exec.queryable]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpmre6apgj/{from.md → to.md} +46 -0
tmp/tmpmre6apgj/{from.md → to.md} RENAMED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Queries and queryables <a id="exec.queryable">[[exec.queryable]]</a>
2
+
3
+ ### General <a id="exec.queryable.general">[[exec.queryable.general]]</a>
4
+
5
+ A *queryable object* is a read-only collection of key/value pair where
6
+ each key is a customization point object known as a *query object*. A
7
+ *query* is an invocation of a query object with a queryable object as
8
+ its first argument and a (possibly empty) set of additional arguments. A
9
+ query imposes syntactic and semantic requirements on its invocations.
10
+
11
+ Let `q` be a query object, let `args` be a (possibly empty) pack of
12
+ subexpressions, let `env` be a subexpression that refers to a queryable
13
+ object `o` of type `O`, and let `cenv` be a subexpression referring to
14
+ `o` such that `decltype((cenv))` is `const O&`. The expression
15
+ `q(env, args...)` is equal to [[concepts.equality]] the expression
16
+ `q(cenv, args...)`.
17
+
18
+ The type of a query expression cannot be `void`.
19
+
20
+ The expression `q(env, args...)` is equality-preserving
21
+ [[concepts.equality]] and does not modify the query object or the
22
+ arguments.
23
+
24
+ If the expression `env.query(q, args...)` is well-formed, then it is
25
+ expression-equivalent to `q(env, args...)`.
26
+
27
+ Unless otherwise specified, the result of a query is valid as long as
28
+ the queryable object is valid.
29
+
30
+ ### `queryable` concept <a id="exec.queryable.concept">[[exec.queryable.concept]]</a>
31
+
32
+ ``` cpp
33
+ namespace std {
34
+ template<class T>
35
+ concept queryable = destructible<T>; // exposition only
36
+ }
37
+ ```
38
+
39
+ The exposition-only `queryable` concept specifies the constraints on the
40
+ types of queryable objects.
41
+
42
+ Let `env` be an object of type `Env`. The type `Env` models `queryable`
43
+ if for each callable object `q` and a pack of subexpressions `args`, if
44
+ `requires { q(env, args...) }` is `true` then `q(env, args...)` meets
45
+ any semantic requirements imposed by `q`.
46
+