Created on 2010-11-12.00:00:00 last changed 172 months ago
Proposed resolution:
Alter the class definition of packaged_task in [futures.task] p. 2 as follows:
template<class R, class... ArgTypes>
class packaged_task<R(ArgTypes...)> {
public:
typedef R result_type;
[...]
};
[ 2011-02-24 Reflector discussion ]
Moved to Tentatively Ready after 5 votes.
packaged_task::operator() always returns void, regardless of the return type of the wrapped task. However, packaged_task::result_type is a typedef to the return type of the wrapped task. This is inconsistent with other uses of result_type in the standard, where it matches the return type of operator() (e.g. function, owner_less). This is confusing.
It also violates the TR1 result_of protocol, and thus makes packaged_task harder to use with anything that respects that protocol.
Finally, it is of little use anyway.
packaged_task::result_type should therefore be removed.
| 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-24 20:02:43 | admin | set | messages: + msg5540 |
| 2011-02-24 20:02:43 | admin | set | status: new -> ready |
| 2011-02-21 17:46:04 | admin | set | messages: + msg5525 |
| 2010-11-12 00:00:00 | admin | create | |