From 04443b1e3acab9a7a3a3ce55252042a24da4f324 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Mon, 5 Feb 2024 13:04:53 +0300 Subject: [PATCH] Support mutable lambdas in ecs::dispatcher --- libs/ecs/include/psemek/ecs/dispatcher.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ecs/include/psemek/ecs/dispatcher.hpp b/libs/ecs/include/psemek/ecs/dispatcher.hpp index c2b351f9..782dcde2 100644 --- a/libs/ecs/include/psemek/ecs/dispatcher.hpp +++ b/libs/ecs/include/psemek/ecs/dispatcher.hpp @@ -30,7 +30,7 @@ namespace psemek::ecs template void handler(Handler handler) { - handlers_[Event::uuid()].push_back([handler = std::move(handler), this](void const * event_ptr){ + handlers_[Event::uuid()].push_back([handler = std::move(handler), this](void const * event_ptr) mutable { auto const & event = *reinterpret_cast(event_ptr); if constexpr (std::invocable) @@ -47,7 +47,7 @@ namespace psemek::ecs template void system(System system) { - handlers_[Event::uuid()].push_back([system = std::move(system), this, cache = container_->cache()](void const * event_ptr){ + handlers_[Event::uuid()].push_back([system = std::move(system), this, cache = container_->cache()](void const * event_ptr) mutable { auto const & event = *reinterpret_cast(event_ptr); if constexpr (std::invocable)