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-08-27
Priority: Not Prioritized
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.
Proposed resolution:
This wording is relative to N5014.
Modify 33.5.1 [exec.fwd.env] as indicated:
-2- The name
forwarding_query
denotes a query object. For some query objectq
of 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.bool
and is a core constant expression ifq
is a core constant expression.
(2.2) — Otherwise,true
ifderived_from<Q, forwarding_query_t>
istrue
.(2.3) — Otherwise,
false
.