From: Martin Quinson Date: Sun, 11 Jun 2017 19:50:18 +0000 (+0200) Subject: allow to declare an actor with parameter without going for a full class object X-Git-Tag: v3.16~63^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4278bfdb328a2edb248f0633c3953a10eab03cdd?ds=sidebyside allow to declare an actor with parameter without going for a full class object --- diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 5517dc62bd..d1121ea7c4 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -175,6 +175,12 @@ public: */ static ActorPtr createActor(const char* name, s4u::Host* host, std::function code); + static ActorPtr createActor(const char* name, s4u::Host* host, std::function)> code, + std::vector args) + { + return createActor(name, host, [code](std::vector args) { code(args); }, args); + } + /** Create an actor using code * * Using this constructor, move-only type can be used. The consequence is