Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use initialization list.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 24 Apr 2018 12:34:11 +0000 (14:34 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 24 Apr 2018 19:19:58 +0000 (21:19 +0200)
examples/s4u/actor-create/s4u-actor-create.cpp

index 8a51c0e..6f18c3a 100644 (file)
@@ -65,7 +65,7 @@ public:
   std::string mbox  = "mb42";
   std::string msg = "GaBuZoMeu";
   explicit Sender() = default; /* Sending the default message */
   std::string mbox  = "mb42";
   std::string msg = "GaBuZoMeu";
   explicit Sender() = default; /* Sending the default message */
-  explicit Sender(std::string arg) { /* Sending the specified message */ msg= arg; }
+  explicit Sender(std::string arg) : msg(arg) { /* Sending the specified message */}
   explicit Sender(std::vector<std::string> args)
   {
     /* This constructor is used when we start the actor from the deployment file */
   explicit Sender(std::vector<std::string> args)
   {
     /* This constructor is used when we start the actor from the deployment file */