Explorar o código

entity: make checks work with 64b identifiers :)

Michele Caini %!s(int64=3) %!d(string=hai) anos
pai
achega
4da7a84518
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      src/entt/entity/entity.hpp

+ 3 - 2
src/entt/entity/entity.hpp

@@ -73,8 +73,9 @@ struct entt_traits<std::uint64_t> {
 template<typename Traits>
 template<typename Traits>
 class basic_entt_traits {
 class basic_entt_traits {
     static constexpr auto length = internal::popcount(Traits::entity_mask);
     static constexpr auto length = internal::popcount(Traits::entity_mask);
-    static_assert(Traits::entity_mask && ((1 << length) == (Traits::entity_mask + 1)), "Invalid entity mask");
-    static_assert((1 << internal::popcount(Traits::version_mask)) == (Traits::version_mask + 1), "Invalid version mask");
+
+    static_assert(Traits::entity_mask && ((typename Traits::entity_type{1} << length) == (Traits::entity_mask + 1)), "Invalid entity mask");
+    static_assert((typename Traits::entity_type{1} << internal::popcount(Traits::version_mask)) == (Traits::version_mask + 1), "Invalid version mask");
 
 
 public:
 public:
     /*! @brief Entity type. */
     /*! @brief Entity type. */