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 {