diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index bd3a12d2a..85720aaae 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -81,9 +81,9 @@ class registry { registry *reg; }; - template + template static void creating(registry ®, const Entity entity) { - if((reg.*Has)(entity)) { + if((reg.pool().has(entity) && ...)) { auto *handler = static_cast *>(reg.handlers[handler_family::type].get()); handler->construct(entity, reg.pools[component_family::type]->get(entity)...); } @@ -121,16 +121,10 @@ class registry { return const_cast> &>(std::as_const(*this).template pool()); } - template - void connect(std::index_sequence) { - pool().construction().template connect<®istry::creating<®istry::has>...>, Component...>>(); - pool().destruction().template connect<®istry::destroying>(); - } - template void connect(std::index_sequence) { - (assure(), ...); - (connect(std::make_index_sequence{}), ...); + (pool().construction().template connect<®istry::creating>(), ...); + (pool().destruction().template connect<®istry::destroying>(), ...); } template