Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mc_api::get_automaton_transition_label() defined and called in run()
[simgrid.git] / src / s4u / s4u_Engine.cpp
index 10502f9fb1f01e475fa0f60a61702244a9a1c90a..f7f8b717cb52718a09194081b05ecb906970448d 100644 (file)
@@ -115,7 +115,7 @@ void Engine::register_function(const std::string& name, const std::function<void
 /** Registers the main function of an actor that will be launched from the deployment file */
 void Engine::register_function(const std::string& name, const std::function<void(std::vector<std::string>)>& code)
 {
-  kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args) {
+  kernel::actor::ActorCodeFactory code_factory = [code{code}](std::vector<std::string> args) mutable {
     return std::bind(std::move(code), std::move(args));
   };
   register_function(name, code_factory);