From bfd99582acd42a47462b429b94d30c9c8f0d5e7f Mon Sep 17 00:00:00 2001 From: Lars Ivar Hatledal Date: Thu, 29 Feb 2024 19:43:30 +0100 Subject: [PATCH] remove ctor with lamda as removal gets tricky. --- include/threepp/core/EventDispatcher.hpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/include/threepp/core/EventDispatcher.hpp b/include/threepp/core/EventDispatcher.hpp index aa615b68..0b7a77fd 100644 --- a/include/threepp/core/EventDispatcher.hpp +++ b/include/threepp/core/EventDispatcher.hpp @@ -27,13 +27,10 @@ namespace threepp { struct FunctionalEventListener: EventListener { - FunctionalEventListener(): FunctionalEventListener([](Event){}){} + FunctionalEventListener(): callback_([](const Event&) {}) {} - FunctionalEventListener(std::function listener) - : callback_(std::move(listener)) {} - - void setListener(std::function f) { - callback_ = std::move(f); + void setListener(std::function listener) { + callback_ = std::move(listener); } void onEvent(Event& event) override {