Title
task shadows the environment's allocator
Status
new
Section
[task.promise]
Submitter
Dietmar Kühl

Created on 2025-08-31.00:00:00 last changed 2 weeks ago

Messages

Date: 2025-08-31.00:00:00

Normally, the get_allocator query forwards the allocator from the receiver's environment. For task the get_allocator query used for co_awaited senders uses the allocator passed when creating the coroutine or the default if there was none. It should use the receiver's environment, at least, if the receiver's environment supports a get_allocator query.

Supporting the receiver's allocator isn't always possible: the used allocator type needs to be known when the coroutine is created. At that time the receiver isn't known, yet. As a result the receiver's environment may provide an allocator which is incompatible with the allocator type used by the coroutine. It may be possible to use the receiver's allcoator if it is convertible to the allocator type used by the coroutine and to produce a compile-time error otherwise.

History
Date User Action Args
2025-08-31 00:00:00admincreate