swap Function (<future>)

swap Function (<future>)

 

Exchanges the associated asynchronous state of one promise object with that of another.

template<class Ty>
   void swap(promise<Ty>& Left, promise<Ty>& Right) noexcept;
template<class Ty, class... ArgTypes>
   void swap(packaged_task<Ty(ArgTypes...)>& Left,
      packaged_task<Ty(ArgTypes...)>& Right) noexcept;

Left

The left promise object.

Right

The right promise object.

Requirements

Header: future

Namespace: std

Show:
© 2016 Microsoft