Namespaces
Variants

std::weak_ptr<T>:: owner_hash

From cppreference.net

Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
std:: size_t owner_hash ( ) const noexcept ;
(C++26以降)

任意のオブジェクト other について owner_equal ( other ) true である場合に、 owner_hash ( ) == other. owner_hash ( ) true となるような未規定の値を返す。

このハッシュ処理は、通常 std::owner_hash を通じて、共有ポインタと弱参照ポインタを非順序連想コンテナのキーとして使用可能にするために用いられます。

目次

戻り値

同じ所有権を共有する任意の std::shared_ptr または std::weak_ptr オブジェクトに対して同一の値。

注記

機能テスト マクロ 標準 機能
__cpp_lib_smart_ptr_owner_equality 202306L (C++26) std::weak_ptr 非順序連想コンテナ のキーとして使用可能にする

関連項目

(C++26)
共有ポインタおよび弱ポインタのためのオーナーベースハッシュを提供する
(クラス)