diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index bb9dc04e9..252957dd9 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -797,18 +797,14 @@ public: for(const auto pack: each()) { std::apply(func, pack); } - } else if constexpr(std::is_invocable_v &>) { - for(auto &&component: *std::get<0>(pools)) { - func(component); - } - } else if constexpr(std::is_invocable_v) { - for(auto entity: *this) { - func(entity); - } - } else { + } else if constexpr(ignore_as_empty_v) { for(size_type pos{}, last = size(); pos < last; ++pos) { func(); } + } else { + for(auto &&component: *std::get<0>(pools)) { + func(component); + } } }