Title
Incorrect semantics of move assignment operator of packaged_task
Status
resolved
Section
[futures.task.members]
Submitter
Daniel Krügler

Created on 2010-12-08.00:00:00 last changed 166 months ago

Messages

Date: 2011-05-21.21:15:19

Proposed resolution:

Resolved 2011-03 Madrid meeting by paper N3278

Date: 2011-06-02.15:28:39

Proposed resolution:

Resolved 2011-03 Madrid meeting by paper N3278

Date: 2011-06-02.15:28:39

According to [futures.task.members] p. 7 bullet 2:

packaged_task& operator=(packaged_task&& other);

7 Effects:

  • [...]

  • packaged_task<R, ArgTypes...>(other).swap(*this).

The argument other given to the move constructor is an lvalue and must be converted into an rvalue via appropriate usage of std::move.

Proposed Resolution

The suggested wording changes are against the working draft N3242.

  1. Change [futures.task.members] p. 7 bullet 2 as indicated:

    packaged_task& operator=(packaged_task&& other);
    

    7 Effects:

    • [...]

    • packaged_task(std::move(other)).swap(*this).

History
Date User Action Args
2011-03-24 21:43:06adminsetmessages: + msg5710
2011-03-24 21:43:06adminsetstatus: immediate -> resolved
2011-03-24 16:04:34adminsetstatus: new -> immediate
2010-12-08 21:48:28adminsetmessages: + msg5474
2010-12-08 00:00:00admincreate