diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 79f475e9c..a7def6aa8 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -1263,7 +1263,7 @@ public: constexpr auto size = sizeof...(Owned) + sizeof...(Get) + sizeof...(Exclude); handler_type *handler = nullptr; - if(auto it = std::find_if(groups.cbegin(), groups.cend(), [](const auto &gdata) { + if(auto it = std::find_if(groups.cbegin(), groups.cend(), [size](const auto &gdata) { return gdata.size == size && (gdata.owned(type_info>::id()) && ...) && (gdata.get(type_info>::id()) && ...) @@ -1290,13 +1290,13 @@ public: if constexpr(sizeof...(Owned) == 0) { groups.push_back(std::move(gdata)); } else { - ENTT_ASSERT(std::all_of(groups.cbegin(), groups.cend(), [](const auto &gdata) { + ENTT_ASSERT(std::all_of(groups.cbegin(), groups.cend(), [size](const auto &gdata) { const auto overlapping = (0u + ... + gdata.owned(type_info>::id())); const auto sz = overlapping + (0u + ... + gdata.get(type_info>::id())) + (0u + ... + gdata.exclude(type_info::id())); return !overlapping || ((sz == size) || (sz == gdata.size)); })); - const auto next = std::find_if_not(groups.cbegin(), groups.cend(), [&size](const auto &gdata) { + const auto next = std::find_if_not(groups.cbegin(), groups.cend(), [size](const auto &gdata) { return !(0u + ... + gdata.owned(type_info>::id())) || (size > (gdata.size)); });