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

Methods

operator id_typeReturns the numeric representation of a given type.
valueReturns the numeric representation of a given type.

Source

Lines 111-128 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_seq<Type>::value();
#endif
    }

    /*! @copydoc value */
    [[nodiscard]] constexpr operator id_type() const ENTT_NOEXCEPT { return value(); }
};





Add Discussion

Log in to comment