diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 687911396..3708d59df 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -197,7 +197,7 @@ public: */ template [[nodiscard]] size_type size() const { - const auto *cpool = pool_if_exists(); + const auto *cpool = pool_if_exists>(); return cpool ? cpool->size() : size_type{}; } @@ -252,7 +252,7 @@ public: */ template [[nodiscard]] size_type capacity() const { - const auto *cpool = pool_if_exists(); + const auto *cpool = pool_if_exists>(); return cpool ? cpool->capacity() : size_type{}; } @@ -291,7 +291,7 @@ public: if constexpr(sizeof...(Component) == 0) { return !alive(); } else { - return [](const auto *...cpool) { return ((!cpool || cpool->empty()) && ...); }(pool_if_exists()...); + return [](const auto *...cpool) { return ((!cpool || cpool->empty()) && ...); }(pool_if_exists>()...); } } @@ -796,7 +796,7 @@ public: template [[nodiscard]] bool all_of(const entity_type entity) const { ENTT_ASSERT(valid(entity), "Invalid entity"); - return [entity](const auto *...cpool) { return ((cpool && cpool->contains(entity)) && ...); }(pool_if_exists()...); + return [entity](const auto *...cpool) { return ((cpool && cpool->contains(entity)) && ...); }(pool_if_exists>()...); } /** @@ -813,7 +813,7 @@ public: template [[nodiscard]] bool any_of(const entity_type entity) const { ENTT_ASSERT(valid(entity), "Invalid entity"); - return [entity](const auto *...cpool) { return !((!cpool || !cpool->contains(entity)) && ...); }(pool_if_exists()...); + return [entity](const auto *...cpool) { return !((!cpool || !cpool->contains(entity)) && ...); }(pool_if_exists>()...); } /** diff --git a/test/entt/entity/registry.cpp b/test/entt/entity/registry.cpp index e6e302e38..c6d923acf 100644 --- a/test/entt/entity/registry.cpp +++ b/test/entt/entity/registry.cpp @@ -170,8 +170,8 @@ TEST(Registry, Functionalities) { ASSERT_EQ(registry.capacity(), ENTT_PACKED_PAGE); ASSERT_EQ(registry.capacity(), ENTT_PACKED_PAGE); ASSERT_EQ(registry.size(), 0u); - ASSERT_EQ(registry.size(), 0u); - ASSERT_TRUE((registry.empty())); + ASSERT_EQ(registry.size(), 0u); + ASSERT_TRUE((registry.empty())); registry.prepare(); @@ -184,17 +184,17 @@ TEST(Registry, Functionalities) { ASSERT_TRUE(registry.all_of<>(e0)); ASSERT_FALSE(registry.any_of<>(e1)); - ASSERT_EQ(registry.size(), 1u); + ASSERT_EQ(registry.size(), 1u); ASSERT_EQ(registry.size(), 1u); - ASSERT_FALSE(registry.empty()); + ASSERT_FALSE(registry.empty()); ASSERT_FALSE(registry.empty()); ASSERT_NE(e0, e1); - ASSERT_FALSE((registry.all_of(e0))); - ASSERT_TRUE((registry.all_of(e1))); - ASSERT_FALSE((registry.any_of(e0))); - ASSERT_TRUE((registry.any_of(e1))); + ASSERT_FALSE((registry.all_of(e0))); + ASSERT_TRUE((registry.all_of(e1))); + ASSERT_FALSE((registry.any_of(e0))); + ASSERT_TRUE((registry.any_of(e1))); ASSERT_EQ(registry.try_get(e0), nullptr); ASSERT_NE(registry.try_get(e1), nullptr); @@ -208,10 +208,10 @@ TEST(Registry, Functionalities) { ASSERT_NO_FATAL_FAILURE(registry.erase(e1)); ASSERT_NO_FATAL_FAILURE(registry.erase(e1)); - ASSERT_TRUE((registry.all_of(e0))); - ASSERT_FALSE((registry.all_of(e1))); - ASSERT_TRUE((registry.any_of(e0))); - ASSERT_FALSE((registry.any_of(e1))); + ASSERT_TRUE((registry.all_of(e0))); + ASSERT_FALSE((registry.all_of(e1))); + ASSERT_TRUE((registry.any_of(e0))); + ASSERT_FALSE((registry.any_of(e1))); const auto e2 = registry.create(); @@ -278,25 +278,25 @@ TEST(Registry, Functionalities) { ASSERT_EQ(registry.get_or_emplace(e3, 'c'), 'c'); ASSERT_EQ(registry.size(), 1u); - ASSERT_EQ(registry.size(), 1u); + ASSERT_EQ(registry.size(), 1u); ASSERT_FALSE(registry.empty()); - ASSERT_FALSE(registry.empty()); + ASSERT_FALSE(registry.empty()); ASSERT_TRUE((registry.all_of(e3))); ASSERT_EQ(registry.get(e3), 3); ASSERT_EQ(registry.get(e3), 'c'); ASSERT_NO_FATAL_FAILURE(registry.clear()); - ASSERT_EQ(registry.size(), 0u); + ASSERT_EQ(registry.size(), 0u); ASSERT_EQ(registry.size(), 1u); - ASSERT_TRUE(registry.empty()); + ASSERT_TRUE(registry.empty()); ASSERT_FALSE(registry.empty()); ASSERT_NO_FATAL_FAILURE(registry.clear()); ASSERT_EQ(registry.size(), 0u); - ASSERT_EQ(registry.size(), 0u); - ASSERT_TRUE((registry.empty())); + ASSERT_EQ(registry.size(), 0u); + ASSERT_TRUE((registry.empty())); const auto e4 = registry.create(); const auto e5 = registry.create(); @@ -306,16 +306,16 @@ TEST(Registry, Functionalities) { ASSERT_EQ(registry.remove(e4), 1u); ASSERT_EQ(registry.remove(e5), 0u); - ASSERT_EQ(registry.size(), 0u); + ASSERT_EQ(registry.size(), 0u); ASSERT_EQ(registry.size(), 0u); ASSERT_TRUE(registry.empty()); ASSERT_EQ(registry.capacity(), ENTT_PACKED_PAGE); - ASSERT_EQ(registry.capacity(), ENTT_PACKED_PAGE); + ASSERT_EQ(registry.capacity(), ENTT_PACKED_PAGE); registry.shrink_to_fit(); - ASSERT_EQ(registry.capacity(), 0u); + ASSERT_EQ(registry.capacity(), 0u); ASSERT_EQ(registry.capacity(), 0u); }