std::swap(std::promise)(3)
hey bestie, welcome to std::swap(std::promise)(3) π this one lives in the C++ Standard Libary manual, and weβre about to make a very niche swap situation make sense, no cap β¨
πΈ NAME πΈ
std::swap(std::promise) β std::swap(std::promise) π«Ά yes, the name section is doing name-on-name realness, and honestly? iconic π
β¨ Synopsis β¨
Defined in header <future> πΈ
template< class R >
void swap( promise<R>& lhs, promise<R>& rhs ) noexcept;
This bad boy is since C++11 π it specializes the std::swap algorithm for std::promise. It exchanges the shared state of lhs with that of rhs, and effectively calls lhs.swap(rhs) β¨
π Parameters π
lhs,rhsβ promises whose states to swap π¦
π¦ Return value π¦
(none) β literally nothing comes back, bestie, it just does the swap and vibes π
π Example π
This section is incomplete Reason: no example
not me leaving the example slot empty π but fr fr, thatβs what the page says π«Ά
π See also π
swapβ swaps twopromiseobjects (public member function) π«
π Category π
* Todo no exampleπ
xoxo, your source/version is http://cppreference.com, dated 2024.06.10, and this manual page is std::swap(std::promise)(3) π
β¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms