33 Execution control library [exec]

33.2 Queries and queryables [exec.queryable]

33.2.1 General [exec.queryable.general]

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.
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...).
The type of a query expression cannot be void.
The expression q(env, args...) is equality-preserving ([concepts.equality]) and does not modify the query object or the arguments.
If the expression env.query(q, args...) is well-formed, then it is expression-equivalent to q(env, args...).
Unless otherwise specified, the result of a query is valid as long as the queryable object is valid.

33.2.2 queryable concept [exec.queryable.concept]

namespace std { template<class T> concept queryable = destructible<T>; // exposition only }
The exposition-only queryable concept specifies the constraints on the types of queryable objects.
Let env be an object of type Env.
The type Env models queryable if for each callable object q and a pack of subexpressions args, if requires { q(env, args...) } is true then q(env, args...) meets any semantic requirements imposed by q.