Created on 2016-07-07.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4606.
Change [futures.async] p6 to:
Throws: system_error if policy == launch::async and the implementation is unable to start a new thread, or std::bad_alloc if memory for the internal data structures could not be allocated.
Change [futures.task.members] p5 to:
template <class F> packaged_task(F&& f); template <class F, class Allocator> packaged_task(allocator_arg_t, const Allocator& a, F&& f);Throws:
- (?) — A
any exceptions thrown by the copy or move constructor of f., or- (?) — For the first version, std::bad_alloc if memory for the internal data structures could not be allocated.
- (?) — For the second version, any exceptions thrown by std::allocator_traits<Allocator>::template rebind_traits<unspecified>::allocate.
[ 2016-08 Chicago ]
Wed PM: Move to Tentatively Ready
[ 2016-07 Chicago ]
Alisdair thinks the third bullet is not quite right.
Previous resolution [SUPERSEDED]:
Change [futures.async] p6 to:
Throws: system_error if policy == launch::async and the implementation is unable to start a new thread, or std::bad_alloc if memory for the internal data structures could not be allocated.
Change [futures.task.members] p5 to:
template <class F> packaged_task(F&& f); template <class F, class Allocator> packaged_task(allocator_arg_t, const Allocator& a, F&& f);Throws:
- (?) — A
any exceptions thrown by the copy or move constructor of f., or- (?) — For the first version, std::bad_alloc if memory for the internal data structures could not be allocated.
- (?) — For the second version, any exceptions thrown by std::allocator_traits<Allocator>::template rebind<unspecified>::allocate.
std::async is a request from the user for type erasure; as any given function gets passed to async which returns only future<ReturnType>. Therefore, it needs to be able to allocate memory, as other issues (e.g. LWG 2202) indicate. However, async's Throws clause doesn't allow an implementation to do this, as it permits only future_error.
std::packaged_task's constructor allocates memory using a user supplied allocator. An implementation needs to call the user's allocate to allocate such memory. The user's allocate function is not constrained to throwing only bad_alloc; it can raise whatever it wants, but packaged_task's constructor prohibits this.History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-11-14 03:59:28 | admin | set | status: pending -> wp |
2016-11-14 03:55:22 | admin | set | status: ready -> pending |
2016-08-04 03:06:12 | admin | set | messages: + msg8390 |
2016-08-04 03:06:12 | admin | set | status: new -> ready |
2016-08-01 18:34:48 | admin | set | messages: + msg8289 |
2016-07-27 19:45:45 | admin | set | messages: + msg8260 |
2016-07-07 00:00:00 | admin | create |