diff --git a/libs/ecs/include/psemek/ecs/container.hpp b/libs/ecs/include/psemek/ecs/container.hpp index 8ecd12e7..f39e59bf 100644 --- a/libs/ecs/include/psemek/ecs/container.hpp +++ b/libs/ecs/include/psemek/ecs/container.hpp @@ -726,9 +726,10 @@ namespace psemek::ecs auto id = next_constructor_id_++; - auto constructor_factory = [function = std::move(function)](std::vector const & column_indices) -> detail::table_callback { - return [function, column_indices](container & container, detail::table & table, std::uint32_t row, util::hash_set const & attached_components, util::hash_set const & detached_components, bool force){ - + auto constructor_factory = [function = std::move(function)](std::vector const & column_indices) -> detail::table_callback + { + return [function, column_indices](container & container, detail::table & table, std::uint32_t row, util::hash_set const & attached_components, util::hash_set const & detached_components, bool force) mutable + { bool const invoke = force || (detail::contains_helper::contains(attached_components) || ...) || (detail::contains_helper::contains_without(detached_components) || ...) @@ -764,8 +765,10 @@ namespace psemek::ecs auto id = next_destructor_id_++; - auto destructor_factory = [function = std::move(function)](std::vector const & column_indices) -> detail::table_callback { - return [function, column_indices](container & container, detail::table & table, std::uint32_t row, util::hash_set const & attached_components, util::hash_set const & detached_components, bool force){ + auto destructor_factory = [function = std::move(function)](std::vector const & column_indices) -> detail::table_callback + { + return [function, column_indices](container & container, detail::table & table, std::uint32_t row, util::hash_set const & attached_components, util::hash_set const & detached_components, bool force) mutable + { bool const invoke = force || (detail::contains_helper::contains_without(attached_components) || ...) || (detail::contains_helper::contains(detached_components) || ...) @@ -800,7 +803,7 @@ namespace psemek::ecs } else { - wrapper = [function = std::move(function)](ecs::container &){ function(); }; + wrapper = [function = std::move(function)](ecs::container &) mutable { function(); }; } if (method_recursion_depth_ == 0)