Merge pull request #435 from Ygrik2003/Refactoring-cmake

Refactoring cmake
This commit is contained in:
Ygrik2003
2025-03-20 20:59:19 +03:00
committed by GitHub
parent a8eda192af
commit 6c3d2d0907
13 changed files with 210 additions and 185 deletions
+6 -6
View File
@@ -1,15 +1,15 @@
#pragma once
#include <mutex>
#include <vector>
#include <algorithm>
#include <mutex>
#include <unordered_map>
#include <vector>
#include "typedefs.hpp"
#include "delegates.hpp"
#include "typedefs.hpp"
namespace util {
template<class...Types>
template <class... Types>
class HandlersList {
int nextid = 1;
std::unordered_map<int, std::function<bool(Types...)>> handlers;
@@ -35,7 +35,7 @@ namespace util {
int id = nextid++;
handlers[id] = std::move(handler);
order.push_back(id);
return observer_handler(new int(id), [this](int* id) { //-V508
return observer_handler(new int(id), [this](int* id) { //-V508
std::lock_guard lock(mutex);
handlers.erase(*id);
order.erase(
@@ -45,7 +45,7 @@ namespace util {
});
}
void notify(Types...args) {
void notify(Types... args) {
std::vector<int> orderCopy;
decltype(handlers) handlersCopy;
{