Title
std::promise should provide non-member swap overload
Status
resolved
Section
[futures.promise]
Submitter
Howard Hinnant

Created on 2009-03-22.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

  1. In [futures.promise], before p.1, immediately after class template promise add:

    
    template <class R>
    void swap(promise<R>& x, promise<R>& y);
    
    
  2. Change [futures.promise]/10 as indicated (to fix a circular definition):

    -10- Effects: swap(*this, other)Swaps the associated state of *this and other

    Throws: Nothing.

  3. After the last paragraph in [futures.promise] add the following prototype description:

    
    template <class R>
    void swap(promise<R>& x, promise<R>& y);
    

    Effects: x.swap(y)

    Throws: Nothing.

Date: 2010-12-05.14:14:49

[ 2009-10 Santa Cruz: ]

NAD EditorialResolved. Addressed by N2997.

Date: 2010-10-21.18:28:33

[ Post Summit Daniel provided wording. ]

Date: 2010-10-21.18:28:33

[ Summit: ]

Create an issue. Move to review, attention: Howard. Detlef will also look into it.

Date: 2012-10-21.13:19:07

Addresses UK 342 [CD1]

std::promise is missing a non-member overload of swap. This is inconsistent with other types that provide a swap member function.

Add a non-member overload void swap(promise&& x,promise&& y){ x.swap(y); }

History
Date User Action Args
2010-12-05 14:14:49adminsetstatus: nad editorial -> resolved
2010-10-21 18:28:33adminsetmessages: + msg653
2010-10-21 18:28:33adminsetmessages: + msg652
2010-10-21 18:28:33adminsetmessages: + msg651
2010-10-21 18:28:33adminsetmessages: + msg650
2009-03-22 00:00:00admincreate