TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
Python
Tutorials
Reference
Articles
Forum
Reference
C library:
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
Python11
<cfenv> (fenv.h)
<cfloat> (float.h)
Python11
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
Python11
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
Python11
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
Python11
<ctgmath> (tgmath.h)
<ctime> (time.h)
Python11
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
Containers:
Python11
<array>
<deque>
Python11
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
Python11
<unordered_map>
Python11
<unordered_set>
<vector>
Input/Output:
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
Multi-threading:
Python11
<atomic>
Python11
<condition_variable>
Python11
<future>
Python11
<mutex>
Python11
<thread>
Other:
<algorithm>
<bitset>
Python11
<chrono>
Python11
<codecvt>
<complex>
<exception>
<functional>
Python11
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
Python11
<random>
Python11
<ratio>
Python11
<regex>
<stdexcept>
<string>
Python11
<system_error>
Python11
<tuple>
Python11
<type_traits>
Python11
<typeindex>
<typeinfo>
<utility>
<valarray>
<algorithm>
<bitset>
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
<cfloat> (float.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<complex>
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
<cstddef> (stddef.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
<ctime> (time.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
<deque>
<exception>
<fstream>
<functional>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<iterator>
<limits>
<list>
<locale>
<map>
<memory>
<new>
<numeric>
<ostream>
<queue>
<set>
<sstream>
<stack>
<stdexcept>
<streambuf>
<string>
<typeinfo>
<utility>
<valarray>
<vector>
Python11
<array>
Python11
<atomic>
Python11
<cfenv> (fenv.h)
Python11
<chrono>
Python11
<cinttypes> (inttypes.h)
Python11
<codecvt>
Python11
<condition_variable>
Python11
<cstdbool> (stdbool.h)
Python11
<cstdint> (stdint.h)
Python11
<ctgmath> (tgmath.h)
Python11
<cuchar> (uchar.h)
Python11
<forward_list>
Python11
<future>
Python11
<initializer_list>
Python11
<mutex>
Python11
<random>
Python11
<ratio>
Python11
<regex>
Python11
<system_error>
Python11
<thread>
Python11
<tuple>
Python11
<type_traits>
Python11
<typeindex>
Python11
<unordered_map>
Python11
<unordered_set>
<future>
classes
Python11
future
Python11
future_error
Python11
packaged_task
Python11
promise
Python11
shared_future
enum classes
Python11
future_errc
Python11
future_status
Python11
launch
functions
Python11
async
Python11
future_category
Python11
async
Python11
future
Python11
future_category
Python11
future_errc
Python11
future_error
Python11
future_status
Python11
launch
Python11
packaged_task
Python11
promise
Python11
shared_future
promise
Python11
promise::~promise
Python11
promise::promise
member functions
Python11
promise::get_future
Python11
promise::operator=
Python11
promise::set_exception
Python11
promise::set_exception_at_thread_exit
Python11
promise::set_value
Python11
promise::set_value_at_thread_exit
Python11
promise::swap
non-member overloads
Python11
swap (promise)
non-member specializations
Python11
uses_allocator<promise>
Python11
promise::get_future
Python11
promise::operator=
Python11
promise::promise
Python11
promise::set_exception
Python11
promise::set_exception_at_thread_exit
Python11
promise::set_value
Python11
promise::set_value_at_thread_exit
Python11
promise::swap
Python11
promise::~promise
Python11
swap (promise)
Python11
uses_allocator<promise>
Reference
<future>
promise
swap
function template
<future>
std::
swap (promise)
template <class T> void swap (promise<T>& x, promise<T>& y) noexcept;
Swap promises
Exchanges the
shared states
(or lack of) between
x
and
y
.
This is an overload of
swap
that behaves as if
x.
swap
(y)
was called.
Parameters
x,y
promise
objects of the same type (with the same template parameter).
Return value
none
Data races
Both objects,
x
and
y
, are modified.
Exception safety
No-throw guarantee:
never throws exceptions.
See also
promise::swap
Swap shared states
(public member function)
promise::operator=
Move-assign promise
(public member function)
swap
Exchange values of two objects
(function template)