Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Whenever possible, use std::move() for parameters (mostly std::string).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 11 Feb 2019 20:09:18 +0000 (21:09 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 12 Feb 2019 16:30:02 +0000 (17:30 +0100)
50 files changed:
include/simgrid/Exception.hpp
include/simgrid/kernel/resource/Action.hpp
include/simgrid/kernel/routing/DragonflyZone.hpp
include/simgrid/s4u/Actor.hpp
include/simgrid/smpi/replay.hpp
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_events.hpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_types.hpp
src/instr/instr_paje_values.cpp
src/instr/instr_private.hpp
src/instr/jedule/jedule_events.cpp
src/instr/jedule/jedule_platform.cpp
src/kernel/activity/ActivityImpl.cpp
src/kernel/activity/ActivityImpl.hpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/IoImpl.cpp
src/kernel/activity/MailboxImpl.hpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/EmptyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/NetPoint.cpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/RoutedZone.cpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/VivaldiZone.cpp
src/plugins/file_system/s4u_FileSystem.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Link.cpp
src/s4u/s4u_Netzone.cpp
src/s4u/s4u_Storage.cpp
src/simix/ActorImpl.cpp
src/simix/libsmx.cpp
src/simix/smx_host.cpp
src/smpi/internals/instr_smpi.cpp
src/smpi/internals/smpi_deployment.cpp
src/surf/PropertyHolder.cpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/sg_platf.cpp
src/surf/storage_n11.cpp
src/xbt/config.cpp
teshsuite/s4u/cloud-sharing/cloud-sharing.cpp

index 675d959..db16dd9 100644 (file)
@@ -34,7 +34,12 @@ class ThrowPoint {
 public:
   ThrowPoint() = default;
   explicit ThrowPoint(const char* file, int line, const char* function, Backtrace bt, std::string actor_name, int pid)
-      : file_(file), line_(line), function_(function), backtrace_(std::move(bt)), procname_(actor_name), pid_(pid)
+      : file_(file)
+      , line_(line)
+      , function_(function)
+      , backtrace_(std::move(bt))
+      , procname_(std::move(actor_name))
+      , pid_(pid)
   {
   }
 
@@ -56,7 +61,7 @@ public:
 class Exception : public std::runtime_error {
 public:
   Exception(simgrid::xbt::ThrowPoint throwpoint, std::string message)
-      : std::runtime_error(message), throwpoint_(throwpoint)
+      : std::runtime_error(std::move(message)), throwpoint_(std::move(throwpoint))
   {
   }
 
@@ -91,8 +96,11 @@ public:
    * @param throwpoint Throw point (use XBT_THROW_POINT)
    * @param message    Exception message
    */
-  xbt_ex(simgrid::xbt::ThrowPoint throwpoint, std::string message) : simgrid::Exception(throwpoint, message) {}
-  
+  xbt_ex(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+      : simgrid::Exception(std::move(throwpoint), std::move(message))
+  {
+  }
+
   xbt_ex(const xbt_ex&) = default;
 
   ~xbt_ex(); // DO NOT define it here -- see ex.cpp for a rationale
@@ -109,7 +117,8 @@ namespace simgrid {
 /** Exception raised when a timeout elapsed */
 class TimeoutError : public xbt_ex {
 public:
-  TimeoutError(simgrid::xbt::ThrowPoint throwpoint, std::string message) : xbt_ex(throwpoint, message)
+  TimeoutError(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+      : xbt_ex(std::move(throwpoint), std::move(message))
   {
     category = timeout_error;
   }
@@ -118,7 +127,8 @@ public:
 /** Exception raised when a host fails */
 class HostFailureException : public xbt_ex {
 public:
-  HostFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message) : xbt_ex(throwpoint, message)
+  HostFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+      : xbt_ex(std::move(throwpoint), std::move(message))
   {
     category = host_error;
   }
@@ -127,7 +137,8 @@ public:
 /** Exception raised when a communication fails because of the network */
 class NetworkFailureException : public xbt_ex {
 public:
-  NetworkFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message) : xbt_ex(throwpoint, message)
+  NetworkFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+      : xbt_ex(std::move(throwpoint), std::move(message))
   {
     category = network_error;
   }
index 2e13349..51d8af9 100644 (file)
@@ -181,7 +181,7 @@ public:
   /** @brief Get the tracing category associated to the current action */
   std::string get_category() const { return category_; }
   /** @brief Set the tracing category of the current Action */
-  void set_category(std::string category) { category_ = category; }
+  void set_category(std::string category) { category_ = std::move(category); }
 
   /** @brief Get the priority of the current Action */
   double get_priority() const { return sharing_priority_; };
index 4b35093..aaec77a 100644 (file)
@@ -73,7 +73,7 @@ public:
 private:
   void generate_routers();
   void generate_links();
-  void create_link(const std::string& id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown);
+  void create_link(std::string id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown);
 
   simgrid::s4u::Link::SharingPolicy sharing_policy_;
   double bw_  = 0;
index 3b1cffa..b6798d3 100644 (file)
@@ -176,7 +176,7 @@ public:
    */
   template <class F> static ActorPtr create(std::string name, s4u::Host* host, F code)
   {
-    return create(name, host, std::function<void()>(std::move(code)));
+    return create(std::move(name), host, std::function<void()>(std::move(code)));
   }
 
   /** Create an actor using a callable thing and its arguments.
@@ -187,7 +187,7 @@ public:
             typename = typename std::result_of<F(Args...)>::type>
   static ActorPtr create(std::string name, s4u::Host* host, F code, Args... args)
   {
-    return create(name, host, std::bind(std::move(code), std::move(args)...));
+    return create(std::move(name), host, std::bind(std::move(code), std::move(args)...));
   }
 
   // Create actor from function name:
index 46f5d86..045b936 100644 (file)
@@ -175,7 +175,7 @@ protected:
   T args;
 
 public:
-  explicit ReplayAction(std::string name) : name(name), my_proc_id(simgrid::s4u::this_actor::get_pid()) {}
+  explicit ReplayAction(std::string name) : name(std::move(name)), my_proc_id(simgrid::s4u::this_actor::get_pid()) {}
   virtual ~ReplayAction() = default;
 
   void execute(simgrid::xbt::ReplayAction& action)
@@ -207,7 +207,9 @@ private:
   RequestStorage& req_storage;
 
 public:
-  explicit SendAction(std::string name, RequestStorage& storage) : ReplayAction(name), req_storage(storage) {}
+  explicit SendAction(std::string name, RequestStorage& storage) : ReplayAction(std::move(name)), req_storage(storage)
+  {
+  }
   void kernel(simgrid::xbt::ReplayAction& action) override;
 };
 
@@ -216,7 +218,9 @@ private:
   RequestStorage& req_storage;
 
 public:
-  explicit RecvAction(std::string name, RequestStorage& storage) : ReplayAction(name), req_storage(storage) {}
+  explicit RecvAction(std::string name, RequestStorage& storage) : ReplayAction(std::move(name)), req_storage(storage)
+  {
+  }
   void kernel(simgrid::xbt::ReplayAction& action) override;
 };
 
@@ -288,13 +292,13 @@ public:
 
 class GatherAction : public ReplayAction<GatherArgParser> {
 public:
-  explicit GatherAction(std::string name) : ReplayAction(name) {}
+  explicit GatherAction(std::string name) : ReplayAction(std::move(name)) {}
   void kernel(simgrid::xbt::ReplayAction& action) override;
 };
 
 class GatherVAction : public ReplayAction<GatherVArgParser> {
 public:
-  explicit GatherVAction(std::string name) : ReplayAction(name) {}
+  explicit GatherVAction(std::string name) : ReplayAction(std::move(name)) {}
   void kernel(simgrid::xbt::ReplayAction& action) override;
 };
 
index edf7c37..7bc177c 100644 (file)
@@ -33,10 +33,10 @@ container_t Container::get_root()
 }
 
 NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZoneContainer* father)
-    : Container::Container(name, "", father)
+    : Container::Container(std::move(name), "", father)
 {
-  netpoint_ = simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name);
-  xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
+  netpoint_ = simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name());
+  xbt_assert(netpoint_, "Element '%s' not found", get_cname());
   if (father_) {
     std::string type_name = std::string("L") + std::to_string(level);
     type_                 = father_->type_->by_name_or_create<ContainerType>(type_name);
@@ -48,12 +48,13 @@ NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZone
   }
 }
 
-RouterContainer::RouterContainer(std::string name, Container* father) : Container::Container(name, "ROUTER", father)
+RouterContainer::RouterContainer(std::string name, Container* father)
+    : Container::Container(std::move(name), "ROUTER", father)
 {
   xbt_assert(father, "Only the Root container has no father");
 
-  netpoint_ = simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name);
-  xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
+  netpoint_ = simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name());
+  xbt_assert(netpoint_, "Element '%s' not found", get_cname());
 
   trivaNodeTypes.insert(type_->get_name());
 }
@@ -69,7 +70,8 @@ HostContainer::HostContainer(simgrid::s4u::Host& host, NetZoneContainer* father)
   trivaNodeTypes.insert(type_->get_name());
 }
 
-Container::Container(std::string name, std::string type_name, Container* father) : name_(name), father_(father)
+Container::Container(std::string name, std::string type_name, Container* father)
+    : name_(std::move(name)), father_(father)
 {
   static long long int container_id = 0;
   id_                               = container_id; // id (or alias) of the container
@@ -117,7 +119,7 @@ Container::~Container()
 
 void Container::create_child(std::string name, std::string type_name)
 {
-  new Container(name, type_name, this);
+  new Container(std::move(name), std::move(type_name), this);
 }
 
 Container* Container::by_name_or_null(std::string name)
index 6760f77..2590273 100644 (file)
@@ -88,7 +88,7 @@ public:
             std::string key, int size)
       : PajeEvent(container, type, SIMIX_get_clock(), event_type)
       , endpoint_(sourceContainer)
-      , value_(value)
+      , value_(std::move(value))
       , key_(key)
       , size_(size)
   {
index 5b39874..f2481a4 100644 (file)
@@ -16,13 +16,13 @@ namespace simgrid {
 namespace instr {
 
 Type::Type(std::string name, std::string alias, std::string color, Type* father)
-    : id_(instr_new_paje_id()), name_(name), color_(color), father_(father)
+    : id_(instr_new_paje_id()), name_(std::move(name)), color_(std::move(color)), father_(father)
 {
-  if (name.empty() || alias.empty())
+  if (name_.empty() || alias.empty())
     THROWF(tracing_error, 0, "can't create a new type with no name or alias");
 
   if (father != nullptr){
-    father->children_.insert({alias, this});
+    father->children_.insert({std::move(alias), this});
     XBT_DEBUG("new type %s, child of %s", name_.c_str(), father->get_cname());
   }
   if (trace_format == simgrid::instr::TraceFormat::Paje) {
@@ -48,13 +48,13 @@ ContainerType::ContainerType(std::string name, Type* father) : Type(name, name,
   log_definition(PAJE_DefineContainerType);
 }
 
-EventType::EventType(std::string name, Type* father) : ValueType(name, father)
+EventType::EventType(std::string name, Type* father) : ValueType(std::move(name), father)
 {
   XBT_DEBUG("EventType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
   log_definition(PAJE_DefineEventType);
 }
 
-StateType::StateType(std::string name, Type* father) : ValueType(name, father)
+StateType::StateType(std::string name, Type* father) : ValueType(std::move(name), father)
 {
   XBT_DEBUG("StateType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
   log_definition(PAJE_DefineStateType);
@@ -90,7 +90,8 @@ void StateType::pop_event(TIData* extra)
   events_.push_back(new StateEvent(issuer_, this, PAJE_PopState, nullptr, extra));
 }
 
-VariableType::VariableType(std::string name, std::string color, Type* father) : Type(name, name, color, father)
+VariableType::VariableType(std::string name, std::string color, Type* father)
+    : Type(name, name, std::move(color), father)
 {
   XBT_DEBUG("VariableType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
   log_definition(PAJE_DefineVariableType);
@@ -136,22 +137,23 @@ void VariableType::sub_event(double timestamp, double value)
   events_.push_back(new VariableEvent(timestamp, issuer_, this, PAJE_SubVariable, value));
 }
 
-LinkType::LinkType(std::string name, std::string alias, Type* father) : ValueType(name, alias, father)
+LinkType::LinkType(std::string name, std::string alias, Type* father)
+    : ValueType(std::move(name), std::move(alias), father)
 {
 }
 void LinkType::start_event(Container* startContainer, std::string value, std::string key)
 {
-  start_event(startContainer, value, key, -1);
+  start_event(startContainer, value, std::move(key), -1);
 }
 
 void LinkType::start_event(Container* startContainer, std::string value, std::string key, int size)
 {
-  new LinkEvent(issuer_, this, PAJE_StartLink, startContainer, value, key, size);
+  new LinkEvent(issuer_, this, PAJE_StartLink, startContainer, value, std::move(key), size);
 }
 
 void LinkType::end_event(Container* endContainer, std::string value, std::string key)
 {
-  new LinkEvent(issuer_, this, PAJE_EndLink, endContainer, value, key, -1);
+  new LinkEvent(issuer_, this, PAJE_EndLink, endContainer, value, std::move(key), -1);
 }
 
 void Type::log_definition(e_event_type event_type)
@@ -206,7 +208,7 @@ void ValueType::add_entity_value(std::string name, std::string color)
 
   auto it = values_.find(name);
   if (it == values_.end()) {
-    EntityValue* new_val = new EntityValue(name, color, this);
+    EntityValue* new_val = new EntityValue(name, std::move(color), this);
     values_.insert({name, new_val});
     XBT_DEBUG("new value %s, child of %s", name.c_str(), get_cname());
     new_val->print();
@@ -225,8 +227,9 @@ EntityValue* ValueType::get_entity_value(std::string name)
 VariableType* Type::by_name_or_create(std::string name, std::string color)
 {
   auto cont = children_.find(name);
-  std::string mycolor = color.empty() ? "1 1 1" : color;
-  return cont == children_.end() ? new VariableType(name, mycolor, this) : static_cast<VariableType*>(cont->second);
+  std::string mycolor = color.empty() ? "1 1 1" : std::move(color);
+  return cont == children_.end() ? new VariableType(name, std::move(mycolor), this)
+                                 : static_cast<VariableType*>(cont->second);
 }
 
 LinkType* Type::by_name_or_create(std::string name, Type* source, Type* dest)
index 443032b..80c7a8b 100644 (file)
@@ -71,7 +71,7 @@ public:
 class ValueType : public Type {
 public:
   std::map<std::string, EntityValue*> values_;
-  ValueType(std::string name, std::string alias, Type* father) : Type(name, alias, "", father){};
+  ValueType(std::string name, std::string alias, Type* father) : Type(std::move(name), std::move(alias), "", father){};
   ValueType(std::string name, Type* father) : Type(name, name, "", father){};
   virtual ~ValueType();
   void add_entity_value(std::string name, std::string color);
index 77b643d..4b584d6 100644 (file)
@@ -13,7 +13,7 @@ namespace simgrid {
 namespace instr {
 
 EntityValue::EntityValue(std::string name, std::string color, Type* father)
-    : id_(instr_new_paje_id()), name_(name), color_(color), father_(father){};
+    : id_(instr_new_paje_id()), name_(std::move(name)), color_(std::move(color)), father_(father){};
 
 void EntityValue::print()
 {
index c61dc20..deed561 100644 (file)
@@ -59,39 +59,39 @@ public:
   std::string recv_type        = "";
 
   // NoOpTI: init, finalize, test, wait, barrier
-  explicit TIData(std::string name) : name_(name){};
+  explicit TIData(std::string name) : name_(std::move(name)){};
   // CPuTI: compute, sleep (+ waitAny and waitall out of laziness)
-  explicit TIData(std::string name, double amount) : name_(name), amount_(amount){};
+  explicit TIData(std::string name, double amount) : name_(std::move(name)), amount_(amount){};
   // Pt2PtTI: send, isend, sssend, issend, recv, irecv
   explicit TIData(std::string name, int endpoint, int size, std::string datatype)
-      : name_(name), endpoint(endpoint), send_size(size), send_type(datatype){};
+      : name_(std::move(name)), endpoint(endpoint), send_size(size), send_type(std::move(datatype)){};
   // CollTI: bcast, reduce, allreduce, gather, scatter, allgather, alltoall
   explicit TIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type,
                   std::string recv_type)
-      : name_(name)
+      : name_(std::move(name))
       , amount_(amount)
       , endpoint(root)
       , send_size(send_size)
       , recv_size(recv_size)
-      , send_type(send_type)
-      , recv_type(recv_type){};
+      , send_type(std::move(send_type))
+      , recv_type(std::move(recv_type)){};
   // VarCollTI: gatherv, scatterv, allgatherv, alltoallv (+ reducescatter out of laziness)
   explicit TIData(std::string name, int root, int send_size, std::vector<int>* sendcounts, int recv_size,
                   std::vector<int>* recvcounts, std::string send_type, std::string recv_type)
-      : TIData(name, root, send_size, std::shared_ptr<std::vector<int>>(sendcounts), recv_size,
-               std::shared_ptr<std::vector<int>>(recvcounts), send_type, recv_type){};
+      : TIData(std::move(name), root, send_size, std::shared_ptr<std::vector<int>>(sendcounts), recv_size,
+               std::shared_ptr<std::vector<int>>(recvcounts), std::move(send_type), std::move(recv_type)){};
 
   explicit TIData(std::string name, int root, int send_size, std::shared_ptr<std::vector<int>> sendcounts,
                   int recv_size, std::shared_ptr<std::vector<int>> recvcounts, std::string send_type,
                   std::string recv_type)
-      : name_(name)
+      : name_(std::move(name))
       , endpoint(root)
       , send_size(send_size)
       , sendcounts(sendcounts)
       , recv_size(recv_size)
       , recvcounts(recvcounts)
-      , send_type(send_type)
-      , recv_type(recv_type){};
+      , send_type(std::move(send_type))
+      , recv_type(std::move(recv_type)){};
 
   virtual ~TIData() {}
 
@@ -103,14 +103,14 @@ public:
 
 class NoOpTIData : public TIData {
 public:
-  explicit NoOpTIData(std::string name) : TIData(name){};
+  explicit NoOpTIData(std::string name) : TIData(std::move(name)){};
   std::string print() override { return getName(); }
   std::string display_size() override { return "NA"; }
 };
 
 class CpuTIData : public TIData {
 public:
-  explicit CpuTIData(std::string name, double amount) : TIData(name, amount){};
+  explicit CpuTIData(std::string name, double amount) : TIData(std::move(name), amount){};
   std::string print() override
   {
     std::stringstream stream;
@@ -124,10 +124,10 @@ class Pt2PtTIData : public TIData {
   int tag;
 public:
   explicit Pt2PtTIData(std::string name, int endpoint, int size, int tag, std::string datatype)
-      : TIData(name, endpoint, size, datatype), tag(tag) {};
+      : TIData(std::move(name), endpoint, size, std::move(datatype)), tag(tag){};
 
   explicit Pt2PtTIData(std::string name, int endpoint, int size, std::string datatype)
-      : TIData(name, endpoint, size, datatype), tag(0) {};
+      : TIData(std::move(name), endpoint, size, std::move(datatype)), tag(0){};
   std::string print() override
   {
     std::stringstream stream;
@@ -142,7 +142,7 @@ class CollTIData : public TIData {
 public:
   explicit CollTIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type,
                       std::string recv_type)
-      : TIData(name, root, amount, send_size, recv_size, send_type, recv_type){};
+      : TIData(std::move(name), root, amount, send_size, recv_size, std::move(send_type), std::move(recv_type)){};
   std::string print() override
   {
     std::stringstream stream;
@@ -164,12 +164,14 @@ class VarCollTIData : public TIData {
 public:
   explicit VarCollTIData(std::string name, int root, int send_size, std::vector<int>* sendcounts, int recv_size,
                          std::vector<int>* recvcounts, std::string send_type, std::string recv_type)
-      : TIData(name, root, send_size, sendcounts, recv_size, recvcounts, send_type, recv_type){};
+      : TIData(std::move(name), root, send_size, sendcounts, recv_size, recvcounts, std::move(send_type),
+               std::move(recv_type)){};
 
   explicit VarCollTIData(std::string name, int root, int send_size, std::shared_ptr<std::vector<int>> sendcounts,
                          int recv_size, std::shared_ptr<std::vector<int>> recvcounts, std::string send_type,
                          std::string recv_type)
-      : TIData(name, root, send_size, sendcounts, recv_size, recvcounts, send_type, recv_type){};
+      : TIData(std::move(name), root, send_size, sendcounts, recv_size, recvcounts, std::move(send_type),
+               std::move(recv_type)){};
 
   std::string print() override
   {
index 96db16e..55c22f7 100644 (file)
@@ -13,7 +13,7 @@ namespace simgrid{
 namespace jedule{
 
 Event::Event(std::string name, double start_time, double end_time, std::string type)
-    : name_(name), start_time_(start_time), end_time_(end_time), type_(type)
+    : name_(std::move(name)), start_time_(start_time), end_time_(end_time), type_(std::move(type))
 {
   this->resource_subsets_ = new std::vector<jed_subset_t>();
 }
index e331627..ad4e515 100644 (file)
@@ -24,8 +24,7 @@ Subset::Subset(int start_idx, int end_idx, Container* parent)
   nres=end_idx-start_idx+1;
 }
 
-
-Container::Container(std::string name): name(name)
+Container::Container(std::string name) : name(std::move(name))
 {
   container_name2container.insert({this->name, this});
 }
index a2cdff3..1cb313a 100644 (file)
@@ -32,7 +32,7 @@ void ActivityImpl::resume()
 void ActivityImpl::set_category(std::string category)
 {
   if (surf_action_)
-    surf_action_->set_category(category);
+    surf_action_->set_category(std::move(category));
 }
 
 // boost::intrusive_ptr<Activity> support:
index ec860fc..70f17ce 100644 (file)
@@ -23,7 +23,7 @@ namespace activity {
 class XBT_PUBLIC ActivityImpl {
 public:
   ActivityImpl() = default;
-  explicit ActivityImpl(std::string name) : name_(name) {}
+  explicit ActivityImpl(std::string name) : name_(std::move(name)) {}
   virtual ~ActivityImpl() = default;
   e_smx_state_t state_ = SIMIX_WAITING; /* State of the activity */
   std::string name_;                    /* Activity name if any */
index cac429a..fbfe28c 100644 (file)
@@ -19,10 +19,10 @@ namespace kernel {
 namespace activity {
 
 ExecImpl::ExecImpl(std::string name, std::string tracing_category, resource::Action* timeout_detector, s4u::Host* host)
-    : ActivityImpl(name), host_(host), timeout_detector_(timeout_detector)
+    : ActivityImpl(std::move(name)), host_(host), timeout_detector_(timeout_detector)
 {
   this->state_ = SIMIX_RUNNING;
-  this->set_category(tracing_category);
+  this->set_category(std::move(tracing_category));
 
   if (timeout_detector != nullptr)
     timeout_detector_->set_data(this);
index 2d21d27..7f8d60b 100644 (file)
@@ -13,7 +13,7 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-IoImpl::IoImpl(std::string name, surf::StorageImpl* storage) : ActivityImpl(name), storage_(storage)
+IoImpl::IoImpl(std::string name, surf::StorageImpl* storage) : ActivityImpl(std::move(name)), storage_(storage)
 {
   this->state_ = SIMIX_RUNNING;
 
index 14c7d91..232c419 100644 (file)
@@ -26,7 +26,7 @@ class MailboxImpl {
   friend mc::CommunicationDeterminismChecker;
 
   explicit MailboxImpl(std::string name)
-      : piface_(this), name_(name), comm_queue_(MAX_MAILBOX_SIZE), done_comm_queue_(MAX_MAILBOX_SIZE)
+      : piface_(this), name_(std::move(name)), comm_queue_(MAX_MAILBOX_SIZE), done_comm_queue_(MAX_MAILBOX_SIZE)
   {
   }
 
index ea7267b..2f3d067 100644 (file)
@@ -18,7 +18,7 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 ClusterZone::ClusterZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : NetZoneImpl(father, name, netmodel)
+    : NetZoneImpl(father, std::move(name), netmodel)
 {
 }
 
index 02cf5c2..a63574b 100644 (file)
@@ -27,7 +27,7 @@ public:
 };
 
 DijkstraZone::DijkstraZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel, bool cached)
-    : RoutedZone(father, name, netmodel), cached_(cached)
+    : RoutedZone(father, std::move(name), netmodel), cached_(cached)
 {
 }
 
index e94fca5..603c605 100644 (file)
@@ -19,7 +19,7 @@ namespace kernel {
 namespace routing {
 
 DragonflyZone::DragonflyZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : ClusterZone(father, name, netmodel)
+    : ClusterZone(father, std::move(name), netmodel)
 {
 }
 
@@ -160,7 +160,7 @@ void DragonflyZone::generate_routers()
   }
 }
 
-void DragonflyZone::create_link(const std::string& id, int numlinks, resource::LinkImpl** linkup,
+void DragonflyZone::create_link(std::string id, int numlinks, resource::LinkImpl** linkup,
                                 resource::LinkImpl** linkdown)
 {
   *linkup   = nullptr;
@@ -169,9 +169,9 @@ void DragonflyZone::create_link(const std::string& id, int numlinks, resource::L
   linkTemplate.bandwidth = this->bw_ * numlinks;
   linkTemplate.latency   = this->lat_;
   linkTemplate.policy    = this->sharing_policy_;
-  linkTemplate.id        = id;
+  linkTemplate.id        = std::move(id);
   sg_platf_new_link(&linkTemplate);
-  XBT_DEBUG("Generating link %s", id.c_str());
+  XBT_DEBUG("Generating link %s", linkTemplate.id.c_str());
   resource::LinkImpl* link;
   if (this->sharing_policy_ == s4u::Link::SharingPolicy::SPLITDUPLEX) {
     *linkup   = s4u::Link::by_name(linkTemplate.id + "_UP")->get_impl();   // check link?
index c07eb06..bd04471 100644 (file)
@@ -16,7 +16,7 @@ namespace kernel {
 namespace routing {
 
 EmptyZone::EmptyZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : NetZoneImpl(father, name, netmodel)
+    : NetZoneImpl(father, std::move(name), netmodel)
 {
 }
 
index eb9758b..b6974dc 100644 (file)
@@ -23,7 +23,7 @@ namespace kernel {
 namespace routing {
 
 FatTreeZone::FatTreeZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : ClusterZone(father, name, netmodel)
+    : ClusterZone(father, std::move(name), netmodel)
 {
   XBT_DEBUG("Creating a new fat tree.");
 }
index ca4c2de..c3d32b3 100644 (file)
@@ -23,7 +23,7 @@ namespace kernel {
 namespace routing {
 
 FloydZone::FloydZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : RoutedZone(father, name, netmodel)
+    : RoutedZone(father, std::move(name), netmodel)
 {
   predecessor_table_ = nullptr;
   cost_table_        = nullptr;
index b703702..f95f6e7 100644 (file)
@@ -17,7 +17,7 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 FullZone::FullZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : RoutedZone(father, name, netmodel)
+    : RoutedZone(father, std::move(name), netmodel)
 {
 }
 
index 2945ccf..87409f6 100644 (file)
@@ -16,7 +16,7 @@ namespace routing {
 simgrid::xbt::signal<void(NetPoint*)> NetPoint::on_creation;
 
 NetPoint::NetPoint(std::string name, NetPoint::Type componentType, NetZoneImpl* netzone_p)
-    : name_(name), component_type_(componentType), englobing_zone_(netzone_p)
+    : name_(std::move(name)), component_type_(componentType), englobing_zone_(netzone_p)
 {
   if (netzone_p != nullptr)
     id_ = netzone_p->add_component(this);
index e727cac..f61f9df 100644 (file)
@@ -27,13 +27,13 @@ public:
 };
 
 NetZoneImpl::NetZoneImpl(NetZoneImpl* father, std::string name, resource::NetworkModel* network_model)
-    : network_model_(network_model), piface_(this), father_(father), name_(name)
+    : network_model_(network_model), piface_(this), father_(father), name_(std::move(name))
 {
-  xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name.c_str()),
-             "Refusing to create a second NetZone called '%s'.", name.c_str());
+  xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name_.c_str()),
+             "Refusing to create a second NetZone called '%s'.", name_.c_str());
 
-  netpoint_ = new NetPoint(name, NetPoint::Type::NetZone, father);
-  XBT_DEBUG("NetZone '%s' created with the id '%u'", name.c_str(), netpoint_->id());
+  netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone, father);
+  XBT_DEBUG("NetZone '%s' created with the id '%u'", name_.c_str(), netpoint_->id());
 }
 
 NetZoneImpl::~NetZoneImpl()
index de14a37..89685b1 100644 (file)
@@ -60,7 +60,7 @@ namespace kernel {
 namespace routing {
 
 RoutedZone::RoutedZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : NetZoneImpl(father, name, netmodel)
+    : NetZoneImpl(father, std::move(name), netmodel)
 {
 }
 
index 7aeceb6..ddecf30 100644 (file)
@@ -30,7 +30,7 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 TorusZone::TorusZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : ClusterZone(father, name, netmodel)
+    : ClusterZone(father, std::move(name), netmodel)
 {
 }
 
index 449914a..369e2ab 100644 (file)
@@ -60,7 +60,7 @@ static std::vector<double>* netpoint_get_coords(NetPoint* np)
 }
 
 VivaldiZone::VivaldiZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : ClusterZone(father, name, netmodel)
+    : ClusterZone(father, std::move(name), netmodel)
 {
 }
 
index 6f3d43a..57c5b40 100644 (file)
@@ -23,18 +23,18 @@ namespace s4u {
 simgrid::xbt::Extension<Storage, FileSystemStorageExt> FileSystemStorageExt::EXTENSION_ID;
 simgrid::xbt::Extension<Host, FileDescriptorHostExt> FileDescriptorHostExt::EXTENSION_ID;
 
-File::File(std::string fullpath, void* userdata) : File(fullpath, Host::current(), userdata){};
+File::File(std::string fullpath, void* userdata) : File(std::move(fullpath), Host::current(), userdata){};
 
-File::File(std::string fullpath, sg_host_t host, void* userdata) : fullpath_(fullpath), userdata_(userdata)
+File::File(std::string fullpath, sg_host_t host, void* userdata) : fullpath_(std::move(fullpath)), userdata_(userdata)
 {
   // this cannot fail because we get a xbt_die if the mountpoint does not exist
   Storage* st                  = nullptr;
   size_t longest_prefix_length = 0;
-  XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath.c_str(), host->get_cname());
+  XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath_.c_str(), host->get_cname());
 
   for (auto const& mnt : host->get_mounted_storages()) {
     XBT_DEBUG("See '%s'", mnt.first.c_str());
-    mount_point_ = fullpath.substr(0, mnt.first.length());
+    mount_point_ = fullpath_.substr(0, mnt.first.length());
 
     if (mount_point_ == mnt.first && mnt.first.length() > longest_prefix_length) {
       /* The current mount name is found in the full path and is bigger than the previous*/
@@ -42,11 +42,11 @@ File::File(std::string fullpath, sg_host_t host, void* userdata) : fullpath_(ful
       st                    = mnt.second;
     }
   }
-  if (longest_prefix_length > 0) { /* Mount point found, split fullpath into mount_name and path+filename*/
-    mount_point_ = fullpath.substr(0, longest_prefix_length);
-    path_        = fullpath.substr(longest_prefix_length, fullpath.length());
+  if (longest_prefix_length > 0) { /* Mount point found, split fullpath_ into mount_name and path+filename*/
+    mount_point_ = fullpath_.substr(0, longest_prefix_length);
+    path_        = fullpath_.substr(longest_prefix_length, fullpath_.length());
   } else
-    xbt_die("Can't find mount point for '%s' on '%s'", fullpath.c_str(), host->get_cname());
+    xbt_die("Can't find mount point for '%s' on '%s'", fullpath_.c_str(), host->get_cname());
 
   local_storage_ = st;
 
index 57f2503..06626a8 100644 (file)
@@ -25,17 +25,17 @@ simgrid::xbt::signal<void(VirtualMachine&)> VirtualMachine::on_migration_start;
 simgrid::xbt::signal<void(VirtualMachine&)> VirtualMachine::on_migration_end;
 
 VirtualMachine::VirtualMachine(std::string name, s4u::Host* physical_host, int core_amount)
-    : VirtualMachine(name, physical_host, core_amount, 1024)
+    : VirtualMachine(std::move(name), physical_host, core_amount, 1024)
 {
 }
 
 VirtualMachine::VirtualMachine(std::string name, s4u::Host* physical_host, int core_amount, size_t ramsize)
-    : Host(name), pimpl_vm_(new vm::VirtualMachineImpl(this, physical_host, core_amount, ramsize))
+    : Host(std::move(name)), pimpl_vm_(new vm::VirtualMachineImpl(this, physical_host, core_amount, ramsize))
 {
   // xbt_assert(s4u::Host::by_name(name) == nullptr,
-  //           "Cannot create a VM named %s: this name is already used by a host or a VM", name.c_str());
+  //           "Cannot create a VM named %s: this name is already used by a host or a VM", get_cname());
 
-  XBT_DEBUG("Create VM %s", name.c_str());
+  XBT_DEBUG("Create VM %s", get_cname());
 
   /* Currently, a VM uses the network resource of its physical host */
   pimpl_netpoint = physical_host->pimpl_netpoint;
index ec1085f..725cd5f 100644 (file)
@@ -40,14 +40,15 @@ ActorPtr Actor::self()
 
 ActorPtr Actor::create(std::string name, s4u::Host* host, std::function<void()> code)
 {
-  simgrid::kernel::actor::ActorImpl* actor = simcall_process_create(name, std::move(code), nullptr, host, nullptr);
+  simgrid::kernel::actor::ActorImpl* actor =
+      simcall_process_create(std::move(name), std::move(code), nullptr, host, nullptr);
   return actor->iface();
 }
 
 ActorPtr Actor::create(std::string name, s4u::Host* host, std::string function, std::vector<std::string> args)
 {
   simgrid::simix::ActorCodeFactory& factory = SIMIX_get_actor_code_factory(function);
-  return create(name, host, factory(std::move(args)));
+  return create(std::move(name), host, factory(std::move(args)));
 }
 
 void intrusive_ptr_add_ref(Actor* actor)
@@ -234,7 +235,7 @@ const char* Actor::get_property(std::string key)
 
 void Actor::set_property(std::string key, std::string value)
 {
-  simgrid::simix::simcall([this, key, value] { pimpl_->set_property(key, value); });
+  simgrid::simix::simcall([this, key, value] { pimpl_->set_property(key, std::move(value)); });
 }
 
 Actor* Actor::restart()
index 047c786..0ecdc72 100644 (file)
@@ -117,14 +117,14 @@ ExecPtr Exec::set_host(Host* host)
 ExecPtr Exec::set_name(std::string name)
 {
   xbt_assert(state_ == State::INITED, "Cannot change the name of an exec after its start");
-  name_ = name;
+  name_ = std::move(name);
   return this;
 }
 
 ExecPtr Exec::set_tracing_category(std::string category)
 {
   xbt_assert(state_ == State::INITED, "Cannot change the tracing category of an exec after its start");
-  tracing_category_ = category;
+  tracing_category_ = std::move(category);
   return this;
 }
 
index 515f776..3b35113 100644 (file)
@@ -29,9 +29,9 @@ simgrid::xbt::signal<void(Host&)> Host::on_destruction;
 simgrid::xbt::signal<void(Host&)> Host::on_state_change;
 simgrid::xbt::signal<void(Host&)> Host::on_speed_change;
 
-Host::Host(std::string name) : name_(name)
+Host::Host(std::string name) : name_(std::move(name))
 {
-  xbt_assert(Host::by_name_or_null(name) == nullptr, "Refusing to create a second host named '%s'.", name.c_str());
+  xbt_assert(Host::by_name_or_null(name_) == nullptr, "Refusing to create a second host named '%s'.", name_.c_str());
   Engine::get_instance()->host_register(std::string(name_), this);
   new simgrid::surf::HostImpl(this);
 }
@@ -194,7 +194,7 @@ const char* Host::get_property(std::string key) const
 
 void Host::set_property(std::string key, std::string value)
 {
-  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
+  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, std::move(value)); });
 }
 /** Specify a profile turning the host on and off according to a exhaustive list or a stochastic law.
  * The profile must contain boolean values. */
index d09897b..afa6825 100644 (file)
@@ -111,7 +111,7 @@ const char* Link::get_property(std::string key)
 }
 void Link::set_property(std::string key, std::string value)
 {
-  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
+  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, std::move(value)); });
 }
 } // namespace s4u
 } // namespace simgrid
index 211a90d..ddb8816 100644 (file)
@@ -39,7 +39,7 @@ const char* NetZone::get_property(std::string key)
 }
 void NetZone::set_property(std::string key, std::string value)
 {
-  simgrid::simix::simcall([this, key, value] { properties_[key] = value; });
+  simgrid::simix::simcall([this, key, value] { properties_[key] = std::move(value); });
 }
 
 /** @brief Returns the list of direct children (no grand-children) */
index 60fcd11..8d0636b 100644 (file)
@@ -21,9 +21,9 @@ simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_creation;
 simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_destruction;
 simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_state_change;
 
-Storage::Storage(std::string name, surf::StorageImpl* pimpl) : pimpl_(pimpl), name_(name)
+Storage::Storage(std::string name, surf::StorageImpl* pimpl) : pimpl_(pimpl), name_(std::move(name))
 {
-  simgrid::s4u::Engine::get_instance()->storage_register(name, this);
+  simgrid::s4u::Engine::get_instance()->storage_register(name_, this);
 }
 
 Storage* Storage::by_name(std::string name)
index f81c789..bb9357c 100644 (file)
@@ -731,7 +731,8 @@ smx_actor_t simcall_process_create(std::string name, simgrid::simix::ActorCode c
 {
   smx_actor_t self = SIMIX_process_self();
   return simgrid::simix::simcall([name, code, data, host, properties, self] {
-    return simgrid::kernel::actor::ActorImpl::create(name, std::move(code), data, host, properties, self).get();
+    return simgrid::kernel::actor::ActorImpl::create(std::move(name), std::move(code), data, host, properties, self)
+        .get();
   });
 }
 
index f8d41b2..68db01c 100644 (file)
@@ -60,7 +60,8 @@ smx_activity_t simcall_execution_parallel_start(const std::string& name, int hos
   xbt_assert(std::isfinite(rate), "rate is not finite!");
 
   return simgrid::simix::simcall([name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout] {
-    return SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
+    return SIMIX_execution_parallel_start(std::move(name), host_nb, host_list, flops_amount, bytes_amount, rate,
+                                          timeout);
   });
 }
 
@@ -399,7 +400,7 @@ smx_activity_t simcall_execution_start(std::string name, std::string category, d
 {
   return simgrid::simix::simcall([name, category, flops_amount, priority, bound, host] {
     return simgrid::kernel::activity::ExecImplPtr(
-               new simgrid::kernel::activity::ExecImpl(name, category, nullptr, host))
+               new simgrid::kernel::activity::ExecImpl(std::move(name), std::move(category), nullptr, host))
         ->start(flops_amount, priority, bound);
   });
 }
index 7bd756a..b7ce26d 100644 (file)
@@ -47,7 +47,7 @@ SIMIX_execution_parallel_start(std::string name, int host_nb, const sg_host_t* h
   }
 
   simgrid::kernel::activity::ExecImplPtr exec = simgrid::kernel::activity::ExecImplPtr(
-      new simgrid::kernel::activity::ExecImpl(name, "", timeout_detector, nullptr));
+      new simgrid::kernel::activity::ExecImpl(std::move(name), "", timeout_detector, nullptr));
   if (surf_action != nullptr) {
     exec->surf_action_ = surf_action;
     exec->surf_action_->set_data(exec.get());
index fc866c9..a355263 100644 (file)
@@ -144,7 +144,7 @@ void TRACE_internal_smpi_set_category(std::string category)
   TRACE_category(category.c_str());
 
   if (not category.empty())
-    process_category[SIMIX_process_self()] = category;
+    process_category[SIMIX_process_self()] = std::move(category);
 }
 
 std::string TRACE_internal_smpi_get_category()
index 441d608..2fbee2e 100644 (file)
@@ -16,8 +16,8 @@ namespace app {
 
 class Instance {
 public:
-  Instance(const std::string name, int max_no_processes, MPI_Comm comm, simgrid::s4u::Barrier* finalization_barrier)
-      : name(name)
+  Instance(std::string name, int max_no_processes, MPI_Comm comm, simgrid::s4u::Barrier* finalization_barrier)
+      : name(std::move(name))
       , size(max_no_processes)
       , present_processes(0)
       , comm_world(comm)
index 53232e0..542ce0b 100644 (file)
@@ -26,7 +26,7 @@ void PropertyHolder::set_property(std::string key, std::string value)
 {
   if (not properties_)
     properties_ = new std::unordered_map<std::string, std::string>;
-  (*properties_)[key] = value;
+  (*properties_)[key] = std::move(value);
 }
 
 /** @brief Return the whole set of properties. Don't mess with it, dude! */
index 0053a4f..be0d45f 100644 (file)
@@ -39,10 +39,10 @@ StorageImpl::StorageImpl(kernel::resource::Model* model, std::string name, kerne
                          std::string attach)
     : Resource(model, name.c_str(), maxminSystem->constraint_new(this, std::max(bread, bwrite)))
     , piface_(name, this)
-    , typeId_(type_id)
-    , content_name(content_name)
+    , typeId_(std::move(type_id))
+    , content_name(std::move(content_name))
     , size_(size)
-    , attach_(attach)
+    , attach_(std::move(attach))
 {
   StorageImpl::turn_on();
   XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
index bb65ba4..3f4461e 100644 (file)
@@ -171,7 +171,12 @@ public:
   StorageType(std::string id, std::string model, std::string content,
               std::unordered_map<std::string, std::string>* properties,
               std::unordered_map<std::string, std::string>* model_properties, sg_size_t size)
-      : id(id), model(model), content(content), properties(properties), model_properties(model_properties), size(size)
+      : id(std::move(id))
+      , model(std::move(model))
+      , content(std::move(content))
+      , properties(properties)
+      , model_properties(model_properties)
+      , size(size)
   {
   }
 };
index a3b956a..37e952b 100644 (file)
@@ -100,9 +100,9 @@ simgrid::kernel::routing::NetPoint* sg_platf_new_router(std::string name, const
   xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name),
              "Refusing to create a router named '%s': this name already describes a node.", name.c_str());
 
-  simgrid::kernel::routing::NetPoint* netpoint =
-      new simgrid::kernel::routing::NetPoint(name, simgrid::kernel::routing::NetPoint::Type::Router, current_routing);
-  XBT_DEBUG("Router '%s' has the id %u", name.c_str(), netpoint->id());
+  simgrid::kernel::routing::NetPoint* netpoint = new simgrid::kernel::routing::NetPoint(
+      std::move(name), simgrid::kernel::routing::NetPoint::Type::Router, current_routing);
+  XBT_DEBUG("Router '%s' has the id %u", netpoint->get_cname(), netpoint->id());
 
   if (coords && strcmp(coords, ""))
     new simgrid::kernel::routing::vivaldi::Coords(netpoint, coords);
index 2b12036..7a8e40a 100644 (file)
@@ -56,13 +56,11 @@ StorageImpl* StorageN11Model::createStorage(std::string id, std::string type_id,
   double Bwrite = surf_parse_get_bandwidth(storage_type->model_properties->at("Bwrite").c_str(),
                                            "property Bwrite, storage", type_id.c_str());
 
-  StorageImpl* storage =
-      new StorageN11(this, id, get_maxmin_system(), Bread, Bwrite, type_id, content_name, storage_type->size, attach);
-
   XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s'\n\t\tBread '%f'\n", id.c_str(), type_id.c_str(),
             Bread);
 
-  return storage;
+  return new StorageN11(this, std::move(id), get_maxmin_system(), Bread, Bwrite, std::move(type_id),
+                        std::move(content_name), storage_type->size, std::move(attach));
 }
 
 double StorageN11Model::next_occuring_event(double now)
index 07d839f..405a583 100644 (file)
@@ -460,7 +460,7 @@ XBT_PUBLIC void declare_flag(std::string name, std::string description, T value,
 {
   if (simgrid_config == nullptr)
     simgrid_config = new simgrid::config::Config();
-  simgrid_config->register_option<T>(name, description, std::move(value), std::move(callback));
+  simgrid_config->register_option<T>(name, std::move(description), std::move(value), std::move(callback));
 }
 
 template XBT_PUBLIC void declare_flag(std::string name, std::string description, int value,
index ec01f8c..4121731 100644 (file)
@@ -42,7 +42,7 @@ static int computation_fun(std::vector<std::string> argv)
 static void run_test_process(std::string name, simgrid::s4u::Host *location, int size)
 {
   std::vector<std::string> arg = {std::to_string(size)};
-  simgrid::s4u::Actor::create(name, location, computation_fun, arg);
+  simgrid::s4u::Actor::create(std::move(name), location, computation_fun, arg);
 }
 
 static void test_energy_consumption(std::string name, int nb_cores)