Skip to content

Commit

Permalink
Make lambdas work as event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusikkala committed Aug 15, 2023
1 parent d5e81a8 commit 44da44d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion monkeroecs.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2462,7 +2462,7 @@ size_t scene::get_event_type_key()
template<typename F>
void scene::internal_add_handler(size_t id, F&& f)
{
using T = decltype(event_handler_type_detector(f));
using T = decltype(event_handler_type_detector(std::function(f)));
size_t key = get_event_type_key<T>();
if(event_handlers.size() <= key) event_handlers.resize(key+1);

Expand Down
2 changes: 1 addition & 1 deletion multi/ecs.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ size_t scene::get_event_type_key()
template<typename F>
void scene::internal_add_handler(size_t id, F&& f)
{
using T = decltype(event_handler_type_detector(f));
using T = decltype(event_handler_type_detector(std::function(f)));
size_t key = get_event_type_key<T>();
if(event_handlers.size() <= key) event_handlers.resize(key+1);

Expand Down

0 comments on commit 44da44d

Please sign in to comment.