diff --git a/Navigator/src/Navigator/Events/Event.h b/Navigator/src/Navigator/Events/Event.h index 7e7b303..3a2413d 100644 --- a/Navigator/src/Navigator/Events/Event.h +++ b/Navigator/src/Navigator/Events/Event.h @@ -47,21 +47,18 @@ namespace Navigator { class NAV_API EventDispatcher { - template - using EventFunc = std::function; - public: EventDispatcher(Event& e) : m_event(e) { } - template - bool Dispatch(EventFunc function) + template + bool Dispatch(const F& function) { if(m_event.GetEventType() == T::GetStaticType()) { - m_event.handledFlag = function(*(T*)&m_event); + m_event.handledFlag = function(static_cast(m_event)); return true; } else diff --git a/Navigator/src/Navigator/NavCore.h b/Navigator/src/Navigator/NavCore.h index 7a7ea64..dedd18b 100644 --- a/Navigator/src/Navigator/NavCore.h +++ b/Navigator/src/Navigator/NavCore.h @@ -16,6 +16,6 @@ //Bit field setter #define BIT(x) (1< decltype(auto) { return this->x(std::forward(args)...); } #endif