std::swap(s...unique_lock)(3)

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

πŸ’… std::swap(s...unique_lock)(3) β€” std::swap(std::unique_lock) ✨

okay so bestie, this page is from the C++ Standard Libary manual, section 3 β€” and yes, β€œLibary” is literally spelled like that in the manual name, no cap πŸ™ˆ. It’s all about std::swap(std::unique_lock), and we’re gonna get you comfy with it πŸ’–.


🌸 NAME 🌸

std::swap(std::unique_lock) β€” std::swap(std::unique_lock)

✨ Synopsis ✨

          template< class Mutex >

          void swap( unique_lock<Mutex>& lhs,             (since C++11)

                     unique_lock<Mutex>& rhs ) noexcept;

So this one specializes the std::swap algorithm for std::unique_lock. It exchanges the state of lhs with that of rhs. Effectively calls lhs.swap(rhs). And the signature is noexcept, periodt πŸ’…. It’s been here since C++11, iykyk ⭐.

πŸŽ€ Parameters πŸŽ€

  • lhs, rhs β€” lock wrappers whose states to swap.

πŸ’– Return value πŸ’–

(none) β€” literally nothing comes back, and that’s iconic 🫢.

πŸ¦‹ Example πŸ¦‹

This section is incomplete Reason: no example

🌈 See also 🌈

  • swap β€” swaps state with another std::unique_lock (public member function)

πŸ“ Category πŸ“

  • * Todo no example

k bye bestie πŸ’‹ this came from http://cppreference.com, version/date 2024.06.10, page std::swap(s...unique_lock)(3) β€” mwah πŸŽ€

πŸ“¦ where this page comes from