#ifndef ENTT_CORE_IDENT_HPP #define ENTT_CORE_IDENT_HPP #include #include #include #include "fwd.hpp" #include "type_traits.hpp" namespace entt { /** * @brief Type integral identifiers. * @tparam Type List of types for which to generate identifiers. */ template class ident { template [[nodiscard]] static constexpr id_type get(std::index_sequence) noexcept { static_assert((std::is_same_v || ...), "Invalid type"); return (0 + ... + (std::is_same_v...>>> ? id_type{Index} : id_type{})); } public: /*! @brief Unsigned integer type. */ using value_type = id_type; /*! @brief Statically generated unique identifier for the given type. */ template static constexpr value_type value = get>(std::index_sequence_for{}); }; } // namespace entt #endif