public member function
<typeindex>

std::type_index::hash_code

size_t hash_code() const;
size_t hash_code() const noexcept;
Get type hash code
Returns a hash code value that identifies the type currently referenced to by the object.

Internally, the function simply returns the result of calling member hash_code on the type_info it refers to.

This function returns the same value for any two type_index objects that compare equal.

Parameters

none

Return Value

A value that identifies the type (runtime constant).
size_t is an unsigned integral type.

Data races

No data races are initiated by this member function.

Exception safety

No-throw guarantee: never throws exceptions.

See also