From 3d3d3ef2d9eaa37199bb3dc9816e491886f2d5d3 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 28 Apr 2023 16:28:13 +0200 Subject: [PATCH] registry: all_of supports non-existing pools now --- src/entt/entity/registry.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) && ...); + } } /**