std::weak_ptr::owner_hash(3)
πΈ NAME πΈ
okay bestie, welcome to the std::weak_ptr::owner_hash(3) page β straight outta the C++ Standard Libary manual (yes, βLibaryβ, weβre keeping the spelling, itβs iconic β¨).
std::weak_ptr::owner_hash β literally std::weak_ptr::owner_hash. thatβs the name, no notes. π
β¨ Synopsis β¨
std::size_t owner_hash() const noexcept; (since C++26)
It returns an unspecified value, but with a very specific rule: for any object other where owner_equal(other) is true, owner_hash() == other.owner_hash() is true. periodt. π«Ά
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βs identical for any std::shared_ptr or std::weak_ptr object sharing the same ownership. same ownership = same value, bestie. π
π§ 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::weak_ptras 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
okay thatβs the whole page, bestie π β source/version: http://cppreference.com; date: 2024.06.10. mwah! π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms