Struct type_hash
Synopsis
#include <src/entt/core/type_info.hpp>
template<typename Type, typename = void>
struct type_hash final
Description
Type hash.
- Template Parameters
Type
- Type for which to generate a hash value.
Mentioned in
- Core Functionalities / Built-in RTTI support
- Core Functionalities / Type info
- Core Functionalities / Almost unique identifiers
- Push EnTT Across Boundaries / Smooth until proven otherwise
Methods
operator id_type | Returns the numeric representation of a given type. | |
value | Returns the numeric representation of a given type. |
Source
Lines 99-118 in src/entt/core/type_info.hpp.
template<typename Type, typename = void>
struct type_hash final {
/**
* @brief Returns the numeric representation of a given type.
* @return The numeric representation of the given type.
*/
#if defined ENTT_PRETTY_FUNCTION
[[nodiscard]] static constexpr id_type value() ENTT_NOEXCEPT {
return internal::type_hash<Type>(0);
#else
[[nodiscard]] static constexpr id_type value() ENTT_NOEXCEPT {
return type_index<Type>::value();
#endif
}
/*! @copydoc value */
[[nodiscard]] constexpr operator id_type() const ENTT_NOEXCEPT {
return value();
}
};