X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/656d1d84782545d13a71b9dbf956ef2c69ec3af6..b4b5dfe452c3d7dd084b0241a954162412ff5ae6:/src/s4u/s4u_Actor.cpp diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index b97212a5df..6cd3ede118 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -47,16 +47,15 @@ ActorPtr Actor::init(std::string name, s4u::Host* host) return actor->ciface(); } -ActorPtr Actor::start(std::function code) +ActorPtr Actor::start(const std::function& code) { - simgrid::simix::simcall([this, code] { pimpl_->start(code); }); + simgrid::simix::simcall([this, &code] { pimpl_->start(code); }); return this; } -ActorPtr Actor::create(std::string name, s4u::Host* host, std::function code) +ActorPtr Actor::create(std::string name, s4u::Host* host, const std::function& code) { - simgrid::kernel::actor::ActorImpl* actor = - simcall_process_create(std::move(name), std::move(code), nullptr, host, nullptr); + simgrid::kernel::actor::ActorImpl* actor = simcall_process_create(std::move(name), code, nullptr, host, nullptr); return actor->iface(); }