Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u] Use std::function<void()> instead of std::function<int()>
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 23 May 2016 08:04:19 +0000 (10:04 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 23 May 2016 08:04:56 +0000 (10:04 +0200)
We don't do anything with the int result anyway.

include/simgrid/s4u/actor.hpp
src/s4u/s4u_actor.cpp

index a58eb6c..d3dd8eb 100644 (file)
@@ -42,12 +42,12 @@ namespace s4u {
 XBT_PUBLIC_CLASS Actor {
   Actor(smx_process_t smx_proc);
 public:
-  Actor(const char* name, s4u::Host *host, double killTime, std::function<int()> code);
-  Actor(const char* name, s4u::Host *host, std::function<int()> code)
+  Actor(const char* name, s4u::Host *host, double killTime, std::function<void()> code);
+  Actor(const char* name, s4u::Host *host, std::function<void()> code)
     : Actor(name, host, -1, std::move(code)) {};
   template<class C>
   Actor(const char* name, s4u::Host *host, C code)
-    : Actor(name, host, -1, std::function<int()>(std::move(code))) {}
+    : Actor(name, host, -1, std::function<void()>(std::move(code))) {}
   ~Actor();
 
   /** Retrieves the actor that have the given PID (or NULL if not existing) */
index b888d9b..0e82cee 100644 (file)
@@ -18,7 +18,7 @@ using namespace simgrid;
 
 s4u::Actor::Actor(smx_process_t smx_proc) : pimpl_(smx_proc) {}
 
-s4u::Actor::Actor(const char* name, s4u::Host *host, double killTime, std::function<int()> code)
+s4u::Actor::Actor(const char* name, s4u::Host *host, double killTime, std::function<void()> code)
 {
   // TODO, when autorestart is used, the std::function is copied so the new
   // instance will get a fresh (reinitialized) state. Is this what we want?