std::shared...::owner_hash(3)

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

Okay bestie, welcome to the std::shared_ptr::owner_hash page from the C++ Standard Library manual β€” the header says C++ Standard Libary (typo and all, we stan πŸ’€) and the page is std::shared...::owner_hash(3). ✨

πŸ’– NAME πŸ’–

std::shared_ptr::owner_hash β€” yeah, it’s literally std::shared_ptr::owner_hash. Main character function energy, no notes. πŸ’…

✨ Synopsis ✨

std::size_t owner_hash() const noexcept;  (since C++26)

It returns an unspecified value such that, for any object other where owner_equal(other) is true, owner_hash() == other.owner_hash() is true. πŸ”₯

This hashing is used to make shared and weak pointers usable as keys in unordered associative containers, typically through std::owner_hash. iykyk.

πŸ’– Return value πŸ’–

A value that is identical for any std::shared_ptr or std::weak_ptr object sharing the same ownership. Slay, consistency. 🫢

🧚 Notes 🧚

Feature-test macro check, bestie:

  • Feature-test macro: __cpp_lib_smart_ptr_owner_equality
  • Value: 202306L
  • Std: (C++26)
  • Feature: Enabling the use of std::shared_ptr as keys in unordered associative containers

🌈 Example 🌈

This section is incomplete. 😭

Reason: example.

πŸ¦‹ See also πŸ¦‹

  • owner_hash β€” provides owner-based hashing for shared and weak pointers (C++26) (class).

πŸ“ Category πŸ“

  • Category: * Todo with reason

Later, bestie β€” source: http://cppreference.com; version/date: 2024.06.10; manual page: std::shared...::owner_hash(3) πŸ’–βœ¨

πŸ“¦ where this page comes from