|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Modifiers | ||||
| Observers | ||||
weak_ptr::owner_hash (C++26) | ||||
(C++26) | ||||
| Non-member functions | ||||
| Helper classes | ||||
(C++20) | ||||
| Deduction guides(C++17) |
std::size_t owner_hash()constnoexcept; | (since C++26) | |
Returns an unspecified value such that for any objectother whereowner_equal(other) istrue,owner_hash()== other.owner_hash() istrue.
This hashing is used to make shared and weak pointers usable as keys in unordered associative containers, typically throughstd::owner_hash.
Contents |
A value that is identical for anystd::shared_ptr orstd::weak_ptr object sharing the same ownership.
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_smart_ptr_owner_equality | 202306L | (C++26) | Enabling the use ofstd::weak_ptr as keys inunordered associative containers |
| This section is incomplete Reason: example |
(C++26) | provides owner-based hashing for shared and weak pointers (class)[edit] |