This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Immediate status.
task::stop_token_typeSection: 33.13.6.4 [task.state] Status: Immediate Submitter: Tomasz Kamiński Opened: 2025-12-08 Last modified: 2026-03-27
Priority: Not Prioritized
View all issues with Immediate status.
Discussion:
Addresses US 249-379
It is not clear what bullet 33.13.6.4 [task.state] p4.6 is – it reads like a requirement on stop_token_type,
but if so, this paragraph is a poor place for it.
[2025-12-05 Tomasz comments]
The paragraph expresses requirements on user supplied Environment::stop_source_type,
that needs to model stoppable-source, which includes stoppable-callback-for
on associated token. We should also require that Environment::scheduler_type shall satisfy scheduler.
We also need to clarify that stop_possible and stop_requested on prom.token returns
same value as st during lifetime of asynchronous operation.
[2026-01-16; Reflector poll.]
Set status to Tentatively Ready after six votes in favour during reflector poll.
[Croydon 2026-03-27; reopen due to conflict with LWG 4347(i).]
Previous resolution [SUPERSEDED]:
This wording is relative to N5014.
Modify 33.13.6 [exec.task] as indicated:
-5-
allocator_typeshall meet the Cpp17Allocator requirements,scheduler_typeshall modelscheduler, andstop_source_typeshall modelstoppable-source.Modify 33.13.6.4 [task.state] as indicated:
void start() & noexcept;-4- Effects: Effects: Let
prombe the objecthandle.promise(). AssociatesSTATE(prom),RCVR(prom), andSCHED(prom)with*thisas follows:Let
- -4.1- […]
- -4.2- […]
- -4.3- […]
stbeget_stop_token(get_env(rcvr)). Initializesprom.tokenandprom.sourcesuch that during the lifetime of the asynchronous operation (33.3 [exec.async.ops]) associated with*this
- -4.4-
prom.token.stop_requested()returnsst.stop_requested();- -4.5-
prom.token.stop_possible()returnsst.stop_possible();.-4.6- for typesFnandInitsuch that bothinvocable<Fn>andconstructible_from<Fn, Init>are modeled,stop_token_type::callback_type<Fn>modelsstoppable-callback-for<Fn, stop_token_type, Init>.
[Croydon 2026-03-27; Jonathan provides new wording]
[Croydon 2026-03-27; Status changed: New → Immediate.]
Proposed resolution:
This wording is relative to N5032.
Modify 33.13.6.2 [task.class] as indicated:
-5-
allocator_typeshall meet the Cpp17Allocator requirements,scheduler_typeshall modelscheduler, andstop_source_typeshall modelstoppable-source.