From 19aab364c6c5a1d49ec47cc8dc9a8cdf911397f6 Mon Sep 17 00:00:00 2001
From: Rainer Kartmann <rainer.kartmann@kit.edu>
Date: Tue, 3 Aug 2021 18:18:29 +0200
Subject: [PATCH] Fix move ctor and assignment ops

---
 .../RobotAPI/libraries/armem/core/longtermmemory/Memory.cpp  | 5 +++--
 .../libraries/armem/core/workingmemory/CoreSegment.cpp       | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.cpp b/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.cpp
index 2080879c5..2f424f9fb 100644
--- a/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.cpp
+++ b/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.cpp
@@ -23,7 +23,7 @@ namespace armarx::armem::ltm
 
 
     Memory::Memory(Memory&& other) :
-        Base(other),
+        Base(std::move(other)),
         dbsettings(other.dbsettings),
         alwaysTransferSettings(other.alwaysTransferSettings),
         periodicTransferSettings(other.periodicTransferSettings),
@@ -49,7 +49,8 @@ namespace armarx::armem::ltm
 
     Memory& Memory::operator=(Memory&& other)
     {
-        Base::operator=(other);
+        Base::operator=(std::move(other));
+
         dbsettings = std::move(other.dbsettings);
         alwaysTransferSettings = std::move(other.alwaysTransferSettings);
         periodicTransferSettings = std::move(other.periodicTransferSettings);
diff --git a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp
index 601f07935..8097ab717 100644
--- a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp
+++ b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp
@@ -16,7 +16,8 @@ namespace armarx::armem::wm
     }
 
 
-    CoreSegment::CoreSegment(CoreSegment&& other) : CoreSegment::Base(other)
+    CoreSegment::CoreSegment(CoreSegment&& other) :
+        CoreSegment::Base(std::move(other))
     {
         // Do not move _mutex.
     }
@@ -32,7 +33,7 @@ namespace armarx::armem::wm
 
     CoreSegment& CoreSegment::operator=(CoreSegment&& other)
     {
-        Base::operator=(other);
+        Base::operator=(std::move(other));
         // Don't move _mutex.
         return *this;
     }
-- 
GitLab