From ad6386c36bf4a375cceb0e0672db4069a141e254 Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 14 Mar 2025 16:23:48 -0500 Subject: [PATCH] change Module::self to reverse_iterator --- src/App.cpp | 2 +- src/Module.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 1c8cf06..8d9a5f1 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -70,8 +70,8 @@ void App::load(std::string lib) { } } - m->setSelf(modules.end()); modules.push_back(m); + m->setSelf(modules.rbegin()); } void App::unload(std::list::iterator it) { diff --git a/src/Module.h b/src/Module.h index 598ef1e..5a9615f 100644 --- a/src/Module.h +++ b/src/Module.h @@ -17,12 +17,12 @@ class Module { std::string getName() const { return name; } void* getHandle() { return handle; } - void setSelf(std::list::iterator s) { self = s; } + void setSelf(std::list::reverse_iterator s) { self = s; } protected: std::string name; void* handle; - std::list::iterator self; + std::list::reverse_iterator self; App& app;