diff --git a/src/entt/entity/prototype.hpp b/src/entt/entity/prototype.hpp index 3f47a6b5a..c968bdac2 100644 --- a/src/entt/entity/prototype.hpp +++ b/src/entt/entity/prototype.hpp @@ -107,7 +107,8 @@ public: handlers.erase(std::remove_if(handlers.begin(), handlers.end(), [](const auto &handler) { using accumulator_type = bool[]; bool match = false; - accumulator_type accumulator = { (match = match || handler.type == registry_type::template type())... }; + auto test = [&handler](bool match, component_type ctype) { return match || handler.type == ctype; }; + accumulator_type accumulator = { (match = test(match, registry_type::template type()))... }; (void)accumulator; return match; }), handlers.end());