Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Use std::move with rvalue references.
[simgrid.git] / include / xbt / functional.hpp
index f5bf973..b7e361e 100644 (file)
@@ -168,8 +168,7 @@ public:
       that.vtable_->move(buffer_, that.buffer_);
     else
       std::memcpy(static_cast<void*>(&buffer_), static_cast<void*>(&that.buffer_), sizeof(buffer_));
-
-    vtable_ = that.vtable_;
+    vtable_      = std::move(that.vtable_);
     that.vtable_ = nullptr;
   }
   Task& operator=(Task const& that) = delete;
@@ -180,7 +179,7 @@ public:
       that.vtable_->move(buffer_, that.buffer_);
     else
       std::memcpy(static_cast<void*>(&buffer_), static_cast<void*>(&that.buffer_), sizeof(buffer_));
-    vtable_ = that.vtable_;
+    vtable_      = std::move(that.vtable_);
     that.vtable_ = nullptr;
     return *this;
   }