This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
2921.packaged_task
and type-erased allocators
Section: 32.10.10 [futures.task] Status: C++17 Submitter: United States Opened: 2017-02-03 Last modified: 2025-06-23
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.
[Sofia 2025-06-21; this was reverted by P3503R3]
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 constructors This 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 an Allocator
argument use it to allocate memory needed to store the internal data structures.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4