Namespaces
Variants

std:: hash <std::indirect>

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)
ヘッダーで定義 <memory>
template < class T, class Allocator >
struct hash < std :: indirect < T, Allocator >> ;
(C++26以降)

std::hash std::indirect に対する部分特殊化は、 indirect オブジェクトが所有するオブジェクトのハッシュ値をユーザーが取得できるようにする。

std:: hash < std :: indirect < T, Allocator >> の特殊化は、 std:: hash < T > が有効な場合に 有効化 され、それ以外の場合は無効化されます。

有効な場合、型 std :: indirect < T, Allocator > のオブジェクト obj に対して、 std:: hash < std :: indirect < T, Allocator >> ( ) ( obj ) は次に評価されます:

  • std:: hash < T > ( ) ( * obj ) 、ただし obj valueless でない場合。
  • 実装定義の値、ただし obj が valueless の場合。

この特殊化のメンバー関数は noexcept であることが保証されていません。なぜなら T のハッシュが例外をスローする可能性があるためです。

関連項目

(C++11)
ハッシュ関数オブジェクト
(クラステンプレート)