swap(std::stop_source)(3)

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

πŸ’… swap(std::stop_source)(3) πŸ’…

okay bestie, welcome to the C++ Standard Libary manual page for swap(std::stop_source) β€” yes, the title is a whole mouthful, but she's iconic and we're gonna break her down. 🫢 This one's all about swapping stop-sources, no cap.


πŸŽ€ NAME πŸŽ€

swap(std::stop_source) β€” yep, that's literally the name: swap(std::stop_source). Main character energy, periodt. ✨

🌸 Synopsis 🌸

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

(since C++20) ⭐

This overloads the std::swap algorithm for std::stop_source. It exchanges the stop-state of lhs with that of rhs. Effectively calls lhs.swap(rhs). That's the whole flex. πŸ’–

🚨 important caveat, bestie: this function is not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::stop_source is an associated class of the arguments. iykyk.

πŸ’– Parameters πŸ’–

  • lhs, rhs β€” the stop_sources to swap. two besties, one swap vibe. πŸ¦‹

πŸ¦‹ Return value πŸ¦‹

(none) β€” literally nothing comes back out. zero. nada. the void. πŸ’€


okay that's the whole page, bestie β€” source: http://cppreference.com, version/date: 2024.06.10. mwah πŸ’‹

πŸ“¦ where this page comes from