namespace std {
template <class T, class Allocator>
struct hash<indirect<T, Allocator>>;
}
概要
std::hashクラスの、std::indirectに対する特殊化。
この特殊化は、hash<T>が有効である場合にのみ有効となる。
効果
indirect<T, Allocator>型のオブジェクトiに対して、hash<indirect<T, Allocator>>()(i)は、iが無効値状態でなければhash<T>()(*i)と同じ値を返し、無効値状態であれば処理系定義の値を返す。
備考
メンバ関数がnoexceptである保証はない。
例
出力
バージョン
言語
- C++26
処理系
- Clang: 22 ❌
- GCC: 16.1 ✅
- Visual C++: 2026 Update 2 ❌