Created on 2024-09-18.00:00:00 last changed yesterday
Proposed resolution:
This wording is relative to N4988.
Modify [futures.task.members] as indicated:
template<class F> explicit packaged_task(F&& f);
-2- Constraints:
remove_cvref_t<F>
is not the same type aspackaged_task<R(ArgTypes...)>
.-3- Mandates:
is_invocable_r_v<R,
is `true`.Fdecay_t<F>&, ArgTypes...>
-4- Preconditions: Invoking a copy of `f` behaves the same as invoking `f`.-5- Effects: Constructs a new `packaged_task` object with a stored task of type
decay_t<F>
and a shared state . Initializesand initializesthe object's stored task withstd::forward<F>(f)
.
[ 2024-10-09; LWG telecon: Move to Ready ]
[ 2024-10-02; LWG telecon ]
Clarify that "of type decay_t<F>
"
is supposed to be specifying the type of the stored task.
[ 2024-10-02; Jonathan provides improved wording ]
Drop preconditions as suggested on reflector.
[ 2024-10-02; Reflector poll ]
Set priority to 3 after reflector poll.
"Fix preconditions, `f` doesn't need to be invocable, we only invoke the copy."
This wording is relative to N4988.
Modify [futures.task.members] as indicated:
-3- Mandates:
[...]is_invocable_r_v<R,
is `true`.Fdecay_t<F>&, ArgTypes...>-5- Effects: Constructs a new `packaged_task` object with a shared state and initializes the object's stored task of type
decay_t<F>
withstd::forward<F>(f)
.
Currently, [futures.task.members]/3 states:
Mandates:
is_invocable_r_v<R, F&, ArgTypes...>
is `true`.
where F&
can be a reference to a cv-qualified function object type.
However, in mainstream implementations (libc++, libstdc++, and MSVC STL), the stored task object always has a cv-unqualified type, and thus the cv-qualification is unrecognizable in `operator()`.
Since [func.wrap.func.con] uses a decayed type, perhaps we should also so specify for `std::packaged_task`.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-11-19 16:09:07 | admin | set | status: ready -> voting |
2024-10-09 16:54:43 | admin | set | messages: + msg14435 |
2024-10-09 16:54:43 | admin | set | status: new -> ready |
2024-10-02 16:35:20 | admin | set | messages: + msg14411 |
2024-10-02 12:45:24 | admin | set | messages: + msg14408 |
2024-10-02 12:43:09 | admin | set | messages: + msg14406 |
2024-09-18 19:52:10 | admin | set | messages: + msg14371 |
2024-09-18 00:00:00 | admin | create |