packaged_task
and type-erased allocatorsSection: 32.10.10 [futures.task] Status: C++17 Submitter: United States Opened: 2017-02-03 Last modified: 2020-09-06
Priority: Not Prioritized
View all other issues in [futures.task].
View all issues with C++17 status.
Discussion:
Addresses US 165The constructor that type-erases an allocator has all of the problems of the similar function constructor that was removed
for this CD. This constructor from packaged_task
should similarly be removed as well. If we prefer to keep this
constructor, the current wording is underspecified, as the Allocator
argument is not required to be type satisfying
the Allocator requirements, nor is allocator_traits
used.
Proposed change:
Strike
template <class F, class Allocator> packaged_task(allocator_arg_t, const Allocator& a, F&& f);
from the class definition in p2, and from 30.6.9.1 [futures.task.members] p2. Strike the last sentence of 30.6.9.1p4. In p3, revise "These constructors" to "This constructor"
[Kona 2017-03-02]
Accepted as Immediate to resolve NB comment.
Proposed resolution:
This wording is relative to N4618.
Modify 32.10.10 [futures.task] as follows:
Strike
template <class F, class Allocator> packaged_task(allocator_arg_t, const Allocator& a, F&& f);
from the class definition in p2, and from [futures.task.members] p2.
Modify 32.10.10.2 [futures.task.members]/3:
Remarks:These constructorsThis constructor shall not participate in overload resolution ifdecay_t<F>
is the same type aspackaged_task<R(ArgTypes...)>
.
Strike the last sentence of 32.10.10.2 [futures.task.members]/4:
The constructors that take anAllocator
argument use it to allocate memory needed to store the internal data structures.