std::type_index:: hash_code
From cppreference.net
<
cpp
|
types
|
type index
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type support
| Basic types | |||||||||||||||||||||
| Fixed width integer types (C++11) | |||||||||||||||||||||
| Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
| Numeric limits | |||||||||||||||||||||
| C numeric limits interface | |||||||||||||||||||||
| Runtime type information | |||||||||||||||||||||
|
|||||||||||||||||||||
std::type_index
| Member functions | ||||
|
type_index::hash_code
|
||||
| Helper classes | ||||
|
(C++11)
|
|
std::
size_t
hash_code
(
)
const
noexcept
;
|
(自 C++11 起) | |
返回关联的 std::type_info 对象的哈希码。等效于直接调用 type_info::hash_code 。
目录 |
参数
(无)
返回值
关联的 std::type_info 对象的哈希码。
示例
|
本节内容不完整
原因:缺少示例 |
缺陷报告
以下行为变更缺陷报告被追溯应用于先前发布的C++标准。
| 缺陷报告 | 适用范围 | 发布时行为 | 正确行为 |
|---|---|---|---|
| LWG 2144 | C++11 |
type_index::hash_code
未要求为 noexcept
|
要求为 noexcept |
参见
|
(C++11)
|
std::type_index
的哈希支持
(类模板特化) |