std::mutex::mutex(3)

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

πŸŽ€ std::mutex::mutex(3) πŸŽ€

okay so bestie, this is the std::mutex::mutex page from the C++ Standard Libary manual β€” constructor content for std::mutex itself. the NAME section is literally std::mutex::mutex - std::mutex::mutex. yes, she said what she said πŸ’…

πŸ¦‹ Synopsis πŸ¦‹

constexpr mutex() noexcept;     (1) (since C++11)
mutex( const mutex& ) = delete; (2) (since C++11)
  1. Constructs the mutex. After the constructor completes, the mutex is in unlocked state ✨
  2. The copy constructor is deleted β€” that's the whole note, periodt πŸ’€

🌸 Parameters 🌸

(none) β€” literally no parameters, bestie. zero. nada. 🫢

πŸ’œ Notes πŸ’œ

Because the default constructor is constexpr, static mutexes are initialized as part of static non-local initialization, before any dynamic non-local initialization begins. That makes it safe to lock a mutex in a constructor of any static object β€” iconic safety behavior, no cap πŸ”₯

⭐ See also ⭐

C documentation for mtx_init πŸ‘€

that's the tea, bestie β€” source: http://cppreference.com, version/date: 2024.06.10, page: std::mutex::mutex(3) πŸŽ€βœ¨

πŸ“¦ where this page comes from