public member function
<typeindex>

std::type_index::hash_code

size_t hash_code() const;
size_t hash_code() const noexcept;
獲取型別雜湊碼
返回一個雜湊碼值,該值標識當前物件引用的型別。

在內部,該函式僅返回在其引用的type_info上呼叫成員hash_code的結果。

對於任何兩個type_index物件,此函式返回相同的值,這些物件比較相等

引數



返回值

標識型別的值(執行時常量)。
size_t 是一個無符號整數型別。

資料競爭

此成員函式不會引發任何資料競爭。

異常安全

無異常保證: 絕不丟擲異常。

另見