std::monostate could be a valid error for taskSection: 33.13.6.5 [task.promise] Status: New Submitter: Dietmar Kühl Opened: 2026-02-21 Last modified: 2026-02-22
Priority: Not Prioritized
View other active issues in [task.promise].
View all other issues in [task.promise].
View all issues with New status.
Discussion:
The current specification of the error-variant in 33.13.6.5 [task.promise] p2 uses std::monostate as a placeholder for the absence of an error: variant<monostate, remove_cvref_t<E>...>. However, std::monostate can be an actual error type. It should be replaced by an implementation-defined, default constructible type.
Proposed resolution:
This wording is relative to N5032.
In 33.13.6.5 [task.promise] p2 replace monostate with an implementation-defined, default constructible type:
-2-error-variantis avariant<, with duplicate types removed, wheremonostateempty, remove_cvref_t<E>...>emptyis an implementation-defined, default constructible type andE...are the parameter types of the template arguments of the specialization ofexecution::completion_signaturesdenoted byerror_types.