Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define set_name() taking Rvalue reference.
[simgrid.git] / src / kernel / activity / ActivityImpl.hpp
index cbabdcd..1f3775d 100644 (file)
@@ -45,6 +45,10 @@ protected:
     // child type
     name_ = name;
   }
+  void inline set_name(std::string&& name)
+  {
+    name_ = std::move(name);
+  }
   void set_start_time(double start_time) { start_time_ = start_time; }
   void clear_hosts() { hosts_.clear(); }
   void add_host(s4u::Host* host) { hosts_.push_back(host); }
@@ -108,6 +112,11 @@ public:
     ActivityImpl::set_name(name);
     return static_cast<AnyActivityImpl&>(*this);
   }
+  AnyActivityImpl& set_name(std::string&& name)
+  {
+    ActivityImpl::set_name(std::move(name));
+    return static_cast<AnyActivityImpl&>(*this);
+  }
 
   AnyActivityImpl& set_tracing_category(std::string_view category)
   {