Title
Unnecessary decay in thread and packaged_task
Status
c++20
Section
[thread.thread.constr][futures.task.members]
Submitter
Stephan T. Lavavej

Created on 2017-11-17.00:00:00 last changed 3 months ago

Messages

Date: 2018-03-18.16:03:30

Proposed resolution:

Wording relative to N4700.

  1. Edit [thread.thread.constr] as indicated:

    template <class F, class... Args> explicit thread(F&& f, Args&&... args);
    

    -3- Requires: […]

    -4- Remarks: This constructor shall not participate in overload resolution if decay_tremove_cvref_t<F> is the same type as std::thread.

  2. Edit [futures.task.members] as indicated:

    template <class F>
      packaged_task(F&& f);
    

    -2- Requires: […]

    -3- Remarks: This constructor shall not participate in overload resolution if decay_tremove_cvref_t<F> is the same type as packaged_task<R(ArgTypes...)>.

Date: 2018-03-17.00:00:00

[ 2018-3-17 Adopted in Jacksonville ]

Date: 2017-11-29.03:09:11

[ 28-Nov-2017 Moved to Tentatively Ready after five positive votes on the ML. ]

Date: 2017-11-17.00:00:00

Following P0777R1 "Treating Unnecessary decay", more occurrences can be fixed. When constraints are checking for the same type as thread or a specialization of packaged_task, decaying functions to function pointers and arrays to object pointers can't affect the result.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2018-03-18 16:03:30adminsetmessages: + msg9749
2018-03-18 16:03:30adminsetstatus: voting -> wp
2018-02-12 01:13:49adminsetstatus: ready -> voting
2017-11-29 03:09:11adminsetmessages: + msg9573
2017-11-29 03:09:11adminsetstatus: new -> ready
2017-11-17 22:26:25adminsetmessages: + msg9566
2017-11-17 00:00:00admincreate