From 8e5be13cc12581b438aa0ae7f020700e2032c65a Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Sun, 15 Dec 2024 20:30:11 +0100 Subject: [PATCH] Review --- src/utils/signal.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/utils/signal.hpp b/src/utils/signal.hpp index 0720454955..4215e44e05 100644 --- a/src/utils/signal.hpp +++ b/src/utils/signal.hpp @@ -1,12 +1,14 @@ -#pragma +#pragma once -#include +#include template class signal_ { public: + using key_type = unsigned; + template - unsigned connect(F f) { + key_type connect(F f) { ++counter; functors[counter] = f; return counter; @@ -26,6 +28,6 @@ class signal_ { } private: - unsigned counter = 0; - std::map> functors; + key_type counter = 0; + std::unordered_map> functors; };