This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
forwarding_query_t by inheriting from itSection: 33.5.1 [exec.fwd.env] Status: New Submitter: Lewis Baker Opened: 2025-08-25 Last modified: 2025-10-17
Priority: 4
View all issues with New status.
Discussion:
The definition of the forwarding_query_t (33.5.1 [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.
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.
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.
[2025-10-17; Reflector poll.]
Set priority to 4 after reflector poll.
"The fact that we didn't use customization by derivation yet doesn't mean we should remove that customization mechanism."
Proposed resolution:
This wording is relative to N5014.
Modify 33.5.1 [exec.fwd.env] as indicated:
-2- The name
forwarding_querydenotes a query object. For some query objectqof typeQ,forwarding_query(q)is expression-equivalent to:
(2.1) —
Mandates: The expression above has typeMANDATE-NOTHROW(q.query(forwarding_query))if that expression is well-formed.booland is a core constant expression ifqis a core constant expression.
(2.2) — Otherwise,trueifderived_from<Q, forwarding_query_t>istrue.(2.3) — Otherwise,
false.