diff --git a/solanaceae/util/event_provider.hpp b/solanaceae/util/event_provider.hpp index 410d54e..0fac178 100644 --- a/solanaceae/util/event_provider.hpp +++ b/solanaceae/util/event_provider.hpp @@ -2,6 +2,7 @@ #include #include +#include template struct EventProviderI { @@ -11,13 +12,13 @@ struct EventProviderI { // TODO: unsub virtual void subscribe(EventI* object, const enumType event_type) { - _subscribers.at(size_t(event_type)).push_back(object); + _subscribers.at(static_cast(event_type)).push_back(object); } protected: template bool dispatch(enumType event_type, const T& event) { - for (auto* zei : _subscribers.at(size_t(event_type))) { + for (auto* zei : _subscribers.at(static_cast(event_type))) { if (zei->onEvent(event)) { return true; } @@ -28,7 +29,7 @@ struct EventProviderI { protected: std::array< std::vector, - size_t(enumType::MAX) + static_cast(enumType::MAX) > _subscribers; };