Browse Source

entity: refine checks to fully support zero-sized versions/fully defined entity masks

Michele Caini 2 years ago
parent
commit
2f1c99ab81
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/entt/entity/entity.hpp

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

@@ -66,8 +66,8 @@ template<typename Traits>
 class basic_entt_traits {
     static constexpr auto length = internal::popcount(Traits::entity_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");
+    static_assert(Traits::entity_mask && ((Traits::entity_mask & (Traits::entity_mask + 1)) == 0), "Invalid entity mask");
+    static_assert((Traits::version_mask & (Traits::version_mask + 1)) == 0, "Invalid version mask");
 
 public:
     /*! @brief Value type. */