交換函式 (<future>)
交換一個 promise 物件 相關聯的非同步狀態 與另一個。
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
表示 promise 物件。Right
無效的 promise 物件。
需求
標題: 未來
命名空間: 可以