Created on 2025-08-25.00:00:00 last changed 5 days ago
Proposed resolution:
This wording is relative to N5014.
Modify [exec.fwd.env] as indicated:
-2- The name `forwarding_query` denotes a query object. For some query object `q` of type `Q`, `forwarding_query(q)` is expression-equivalent to:
(2.1) — MANDATE-NOTHROW(q.query(forwarding_query)) if that expression is well-formed.
Mandates: The expression above has type `bool` and is a core constant expression if `q` is a core constant expression.
(2.2) — Otherwise, `true` if derived_from<Q, forwarding_query_t> is `true`.(2.3) — Otherwise, `false`.
The definition of the `forwarding_query_t` ([exec.fwd.env]) states that a query is a forwarding-query if either the expression `q.query(forwarding_query)` is a constant expression that evaluates to `true` or the query type inherits from `forwarding_query_t`.
However, all of the queries defined in [exec] are defined similar to the following:struct get_allocator_t { unspecified };
While this definition allows for the members of the class to be unspecified, it still explicitly specifies that it has an empty list of base-classes and therefore cannot customize `forwarding_query_t` by inheriting from `forwarding_query_t`.
We should consider whether we want to change the specification of queries that are to be forwarding-queries to allow inheritance from `forwarding_query_t` or otherwise remove the support for customizing `forwarding_query_t` by inheriting from it. Proposed Approach: Remove the rule that checks for inheritance from `forwarding_query_t`. Any query can already customize `forwarding_query_t` by defining a `query(forwarding_query_t)` member function, so there is no loss of functionality from doing this and it would simplify the design.History | |||
---|---|---|---|
Date | User | Action | Args |
2025-08-27 15:33:50 | admin | set | messages: + msg14967 |
2025-08-25 00:00:00 | admin | create |