From dab8ad27bea0572ea8134916593e021949c00848 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Tue, 25 Jul 2023 16:21:53 +0200 Subject: [PATCH] try fix size_t --- solanaceae/util/event_provider.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; };