Title
Standard defined queries can't customize `forwarding_query_t` by inheriting from it
Status
new
Section
[exec.fwd.env]
Submitter
Lewis Baker

Created on 2025-08-25.00:00:00 last changed 5 days ago

Messages

Date: 2025-08-27.15:33:50

Proposed resolution:

This wording is relative to N5014.

  1. 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:

    1. (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.2) — Otherwise, `true` if derived_from<Q, forwarding_query_t> is `true`.

    3. (2.3) — Otherwise, `false`.

Date: 2025-08-25.00:00:00

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:50adminsetmessages: + msg14967
2025-08-25 00:00:00admincreate