X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d2c2569a6b3d6a0a4ff772359351d0fdfa53551b..e04af740db254a5aadccc142a53d2738b2b4cf56:/include/xbt/signal.hpp diff --git a/include/xbt/signal.hpp b/include/xbt/signal.hpp index 08fbff611a..d5ad826fa2 100644 --- a/include/xbt/signal.hpp +++ b/include/xbt/signal.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -7,6 +7,7 @@ #define SIMGRID_XBT_SIGNAL_HPP #include +#include #include namespace simgrid { @@ -26,15 +27,14 @@ namespace xbt { typedef std::function callback_type; std::vector handlers_; public: - template XBT_ALWAYS_INLINE + template void connect(U slot) { handlers_.push_back(std::move(slot)); } - XBT_ALWAYS_INLINE R operator()(P... args) const { - for (auto& handler : handlers_) + for (auto const& handler : handlers_) handler(args...); } void disconnect_all_slots()