Created on 2011-02-09.00:00:00 last changed 162 months ago
Proposed resolution:
(wording written assuming LWG 1514 is also accepted)
Change [futures.task.members] paragraph 3:
3 Effects: constructs a new packaged_task object with an associated asynchronous state and
stores a copy of f as the object's stored taskinitializes the object's stored task with std::forward<F>(f). The constructors that take an Allocator argument use it to allocate memory needed to store the internal data structures.
Change [futures.task.members] paragraph 5:
5 Effects: constructs a new packaged_task object and transfers ownership of other's associated asynchronous state to *this, leaving other with no associated asynchronous state. Moves the stored task from other to *this.
[ 2011-02-26 Reflector discussion ]
Moved to Tentatively Ready after 5 votes.
[ 2011-02-25: Alberto updates wording ]
Related with LWG issue 1514.
The move constructor of packaged_task does not specify how the stored task is constructed. The obvious way is to move-construct it using the task stored in the argument. Moreover, the constructor should be provided with a throws clause similar to one used for the other constructors, as the move constructor of the stored task is not required to be nothrow.
As for the other constructors, the terms "stores a copy of f" do not reflect the intent, which is to allow f to be moved when possible.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2011-04-11 11:23:23 | admin | set | status: voting -> wp |
2011-03-05 15:24:28 | admin | set | status: ready -> voting |
2011-02-26 19:50:01 | admin | set | messages: + msg5557 |
2011-02-26 19:50:01 | admin | set | status: new -> ready |
2011-02-25 15:42:20 | admin | set | messages: + msg5545 |
2011-02-11 18:49:33 | admin | set | messages: + msg5483 |
2011-02-09 00:00:00 | admin | create |