From 4278bfdb328a2edb248f0633c3953a10eab03cdd Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 11 Jun 2017 21:50:18 +0200 Subject: [PATCH] allow to declare an actor with parameter without going for a full class object --- include/simgrid/s4u/Actor.hpp | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.20.1