std::weak_ptr<T>::owner_hash
From cppreference.com
| std::size_t owner_hash() const noexcept; |
(C++26以降) | |
owner_equal(other) が true であるような任意のオブジェクト other に対して、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) |
shared ポインタと weak ポインタの、所有者ベースのハッシュ化を提供します (クラス) |