swap(std::stop_token)(3)

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

🌸 swap(std::stop_token) 🌸

okay bestie, welcome to the C++ Standard Libary manual page for swap(std::stop_token) β€” section 3 energy, and yes that spelling is exactly what the manual name says, we're keeping it πŸ’…

πŸ’– NAME πŸ’–

swap(std::stop_token) β€” swap(std::stop_token) (the name is literally the name, and honestly? iconic.)

✨ Synopsis ✨

friend void swap( stop_token& lhs, stop_token& rhs ) noexcept;

(since C++20)

This overloads the std::swap algorithm for std::stop_token. It exchanges the associated stop-state of lhs with that of rhs. Effectively calls lhs.swap(rhs).

bestie listen: this function is not visible to ordinary unqualified or qualified lookup. It can only be found by argument-dependent lookup when std::stop_token is an associated class of the arguments. It's giving hidden ADL-only main-character function. 🫢

πŸŽ€ Parameters πŸŽ€

  • lhs, rhs β€” stop_tokens to swap

🌈 Return value 🌈

(none) β€” literally nothing comes back, bestie, it just does the swap and leaves. πŸ’…


mwah πŸ’– this iconic little page is from http://cppreference.com, dated 2024.06.10 β€” periodt. πŸŽ€

πŸ“¦ where this page comes from