#ifndef ENTT_CORE_IDENT_HPP #define ENTT_CORE_IDENT_HPP #include "../stl/cstddef.hpp" #include "../stl/type_traits.hpp" #include "../stl/utility.hpp" #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 ENTT_CONSTEVAL id_type get(stl::index_sequence) noexcept { return (0 + ... + (stl::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 requires (stl::is_same_v, Type> || ...) static constexpr value_type value = get>(stl::index_sequence_for{}); }; } // namespace entt #endif