std::promise::swap(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– std::promise::swap(3) πŸ’–

hey bestie, we’re in the C++ Standard Libary manual and this page is about std::promise::swap. The title is std::promise::swap(3), and honestly it’s a tiny but iconic little member. πŸ’…


🌸 NAME 🌸

std::promise::swap β€” std::promise::swap (the name is doing the most, but periodt).

✨ Synopsis ✨

void swap( promise& other ) noexcept;  (since C++11)

It exchanges the shared states of two promise objects. No cap. πŸ¦‹

πŸŽ€ Parameters πŸŽ€

  • other β€” the promise to swap with. That’s it, that’s the parameter bestie.

πŸ’œ Return value πŸ’œ

  • (none) β€” literally none. It’s void, so no return value to catch. 🫢

πŸ”₯ Example πŸ”₯

This section is incomplete. Reason: no example.

not me staring at an incomplete example section 😭. That’s the whole tea: no example provided.

πŸ‘‘ See also πŸ‘‘

  • std::swap(std::promise) β€” specializes the std::swap algorithm. It’s a function template, and it’s C++11 coded. ✨

🧚 Category 🧚

  • Todo no example

xoxo, this page came from http://cppreference.com, source/version 2024.06.10, and it’s std::promise::swap(3). bye bestie, go swap those shared states πŸ’–πŸŽ€

πŸ“¦ where this page comes from