Title
Query objects must be default constructible
Status
wp
Section
[exec.queryable.general]
Submitter
Eric Niebler

Created on 2025-05-07.00:00:00 last changed 1 month ago

Messages

Date: 2025-11-11.10:48:55

Proposed resolution:

This wording is relative to N5014.

  1. Modify [customization.point.object] as indicated:

    -1- A customization point object is a function object ([function.objects]) with a literal class type that interacts with program-defined types while enforcing semantic requirements on that interaction.

    -2- The type of a customization point object, ignoring cv-qualifiers, shall model `semiregular` ([concepts.object]) and shall be a structural type ([temp.param]) and a trivially copyable type ([class.prop]). Every constructor of this type shall have a non-throwing exception specification ([except.spec]).

Date: 2025-11-11.10:48:55

[ Kona 2025-11-08; Status changed: Immediate → WP. ]

Date: 2025-11-07.02:49:55

[ Kona 2025-11-07; approved by LWG. Status changed: New → Immediate. ]

Date: 2025-11-15.00:00:00

[ 2025-11-05; Tim provides improved wording ]

LWG decided to guarantee some additional properties for CPOs.

Date: 2025-10-15.00:00:00

[ 2025-10-23; Reflector poll. ]

Set priority to 2 after reflector poll.

"The discussion is wrong, `semiregular` requires `default_initializable`. If we want to mandate nothrow construction (a.k.a the implementation isn't out to get you), I'd rather we do it for all CPOs."

This wording is relative to N5008.

  1. Modify [exec.queryable.general] as indicated:

    -1- 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. The type of a query object satisfies `default_initializable`, and its default constructor is not potentially throwing. 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.

Date: 2025-05-07.00:00:00

Imported from cplusplus/sender-receiver #333.

We require the types of query objects such as `get_scheduler` to be customization point objects. [customization.point.object] requires them to be `semiregular` but that concept does not require default constructability. Much of `std::execution` assumes query object types to be default constructible.

I propose adding a (nothrow) default-constructibility requirement.

History
Date User Action Args
2025-11-11 10:48:55adminsetmessages: + msg15667
2025-11-11 10:48:55adminsetstatus: immediate -> wp
2025-11-07 02:49:55adminsetmessages: + msg15579
2025-11-07 02:49:55adminsetstatus: new -> immediate
2025-11-06 03:53:16adminsetmessages: + msg15553
2025-10-23 12:39:14adminsetmessages: + msg15395
2025-05-18 09:48:20adminsetmessages: + msg14757
2025-05-07 00:00:00admincreate