Search:
Reference
<future>
promise
swap
public member function
<future>
std::
promise
::swap
void swap (promise& x) noexcept;
Swap shared states
Exchanges the
shared state
(if any) with
x
.
Parameters
x
Another
promise
object of the same type (with the same template parameter
T
).
Return value
none
Data races
Both
x
and the object are modified.
Exception safety
No-throw guarantee:
never throws exceptions.
See also
promise::operator=
Move-assign promise
(public member function )
promise::promise
Construct promise
(public member function )
promise::set_value
Set value
(public member function )
C++
Information
Tutorials
Reference
Articles
Forum
Reference
C library:
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
<cfenv> (fenv.h)
<cfloat> (float.h)
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
<ctgmath> (tgmath.h)
<ctime> (time.h)
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
Containers:
<array>
<deque>
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
<unordered_map>
<unordered_set>
<vector>
Input/Output:
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
Multi-threading:
<atomic>
<condition_variable>
<future>
<mutex>
<thread>
Other:
<algorithm>
<bitset>
<chrono>
<codecvt>
<complex>
<exception>
<functional>
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
<random>
<ratio>
<regex>
<stdexcept>
<string>
<system_error>
<tuple>
<typeindex>
<typeinfo>
<type_traits>
<utility>
<valarray>
<future>
classes:
future
future_error
packaged_task
promise
shared_future
enum classes:
future_errc
future_status
launch
functions:
async
future_category
promise
promise::promise
promise::~promise
member functions:
promise::get_future
promise::operator=
promise::set_exception
promise::set_exception_at_thread_exit
promise::set_value
promise::set_value_at_thread_exit
promise::swap
non-member overloads:
swap (promise)
non-member specializations:
uses_allocator<promise>