Skip to content

Commit

Permalink
remove ctor with lamda as removal gets tricky.
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren committed Feb 29, 2024
1 parent 236ccf3 commit bfd9958
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions include/threepp/core/EventDispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,10 @@ namespace threepp {

struct FunctionalEventListener: EventListener {

FunctionalEventListener(): FunctionalEventListener([](Event){}){}
FunctionalEventListener(): callback_([](const Event&) {}) {}

FunctionalEventListener(std::function<void(Event)> listener)
: callback_(std::move(listener)) {}

void setListener(std::function<void(Event)> f) {
callback_ = std::move(f);
void setListener(std::function<void(Event)> listener) {
callback_ = std::move(listener);
}

void onEvent(Event& event) override {
Expand Down

0 comments on commit bfd9958

Please sign in to comment.