Created on 2017-06-13.00:00:00 last changed 46 months ago
Proposed resolution:
This wording is relative to N4659.
Modify [future.syn], header <future> synopsis, and [futures.task], class template packaged_task synopsis, as indicated:
template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
Modify [futures.task.nonmembers] as indicated:
template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc> : true_type { };
-2- Requires: Alloc shall be an Allocator (20.5.3.5).
Modify [futures.task.members]/5 as indicated:
template <class F> packaged_task(F&& F);-2- Requires: […]
-3- Remarks: […]
-4- Effects: […]
-5- Throws:
— Aany exceptions thrown by the copy or move constructor of f., or
— For the first version,bad_alloc if memory for the internal data structures could not be allocated.
— For the second version, any exceptions thrown by allocator_traits<Allocator>::template rebind_traits<unspecified>::allocate.
[ 2016-07, Toronto Saturday afternoon issues processing ]
Status to Ready
[ 2017-06-26, Billy O'Neal reopens ]
I think 2921 was resolved in error. If promise<T> can have an allocator, there's no reason for packaged_task<T> to not have one. If we remove it from packaged_task we should remove it from promise as well.
Note that I am not objecting to removing allocator support here, I'm objecting to the "remove it because this looks like std::function" case. packaged_task has none of the std::function problems because the function inside a given packaged_task is not reassignable. If LWG decides to remove allocator support here then there are more bits that need to be struck, e.g. [futures.task.members] (5.3).[ 2017-06-26 Moved to Tentatively Ready after 6 positive votes on c++std-lib. ]
When LWG 2921 removed allocator support from packaged_task, it forgot to remove the uses_allocator partial specialization.
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2017-11-13 19:01:36 | admin | set | status: voting -> wp |
2017-10-17 18:34:55 | admin | set | status: ready -> voting |
2017-07-16 20:43:29 | admin | set | messages: + msg9425 |
2017-07-16 20:43:29 | admin | set | status: open -> ready |
2017-06-26 19:30:49 | admin | set | messages: + msg9292 |
2017-06-26 18:48:59 | admin | set | messages: + msg9288 |
2017-06-26 18:48:59 | admin | set | status: ready -> open |
2017-06-26 17:35:23 | admin | set | messages: + msg9287 |
2017-06-26 17:35:23 | admin | set | status: new -> ready |
2017-06-13 19:25:09 | admin | set | messages: + msg9254 |
2017-06-13 00:00:00 | admin | create |