diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 92b69ce78..d0a4921af 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -961,7 +961,12 @@ public: */ template [[nodiscard]] bool all_of(const entity_type entt) const { - return (assure>()->contains(entt) && ...); + if constexpr(sizeof...(Type) == 1u) { + auto *cpool = assure...>(); + return cpool && cpool->contains(entt); + } else { + return (all_of(entt) && ...); + } } /**