X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ed37babb2fa9097abe82df299c0aa259ed84d5a..a7cc502f224afb96f0203b94759cd0dabebf8de5:/include/xbt/signal.hpp diff --git a/include/xbt/signal.hpp b/include/xbt/signal.hpp index 42c043586f..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,17 +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(); } - /** Get the amount of callbacks */ - int get_slot_count() { return handlers_.size(); } }; -} -} +} // namespace simgrid::xbt #endif