diff --git a/include/cpp_active_objects/Hsm.hxx b/include/cpp_active_objects/Hsm.hxx index 55280f6..d7e2647 100644 --- a/include/cpp_active_objects/Hsm.hxx +++ b/include/cpp_active_objects/Hsm.hxx @@ -11,6 +11,7 @@ #pragma once #include +#include #include #include @@ -68,7 +69,7 @@ private: void RecallEvents() { - for (const auto& event : deferred_events_) + for (const auto& event : std::ranges::reverse_view(deferred_events_)) { TakeHighPrio(event); } diff --git a/include/cpp_active_objects_embedded/Hsm.hxx b/include/cpp_active_objects_embedded/Hsm.hxx index d4d4009..d02951e 100644 --- a/include/cpp_active_objects_embedded/Hsm.hxx +++ b/include/cpp_active_objects_embedded/Hsm.hxx @@ -11,6 +11,7 @@ #pragma once #include +#include #include #include @@ -68,7 +69,7 @@ private: void RecallEvents() { - for (const auto& event : deferred_events_) + for (const auto& event : std::ranges::reverse_view(deferred_events_)) { TakeHighPrio(event); }