X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9952628e8e09510ab16f47e7262dff27533119c1..8d62bb541920e2e4e0f7d1fa26a7f6eec79370c2:/include/xbt/signal.hpp diff --git a/include/xbt/signal.hpp b/include/xbt/signal.hpp index 8b6cf9164d..70c477f6e6 100644 --- a/include/xbt/signal.hpp +++ b/include/xbt/signal.hpp @@ -10,8 +10,7 @@ #include #include -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { template class signal; @@ -35,15 +34,14 @@ public: /** Fire that signal, invoking all callbacks */ R operator()(P... args) const { - for (auto const& handler : handlers_) - handler.second(args...); + for (auto const& [_, callback] : handlers_) + callback(args...); } /** Remove a callback */ void disconnect(unsigned int id) { handlers_.erase(id); } /** Remove all callbacks */ void disconnect_slots() { handlers_.clear(); } }; -} -} +} // namespace simgrid::xbt #endif