From b8bd8d64b6eb0e7936f04de9ba2e8a13a829e74e Mon Sep 17 00:00:00 2001
From: Rainer Kartmann <rainer.kartmann@kit.edu>
Date: Fri, 16 Jul 2021 11:09:01 +0200
Subject: [PATCH] Implement =(&), =(&&) operators of CoreSegment

---
 .../armem/core/workingmemory/CoreSegment.cpp  | 22 +++++++++++++++++++
 .../armem/core/workingmemory/CoreSegment.h    |  6 ++---
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp
index 47f361a42..dd23bddb5 100644
--- a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp
+++ b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp
@@ -16,6 +16,28 @@ namespace armarx::armem::wm
     }
 
 
+    CoreSegment::CoreSegment(CoreSegment&& other) : CoreSegment::Base(other)
+    {
+        // Do not move _mutex.
+    }
+
+
+    CoreSegment& CoreSegment::operator=(const CoreSegment& other)
+    {
+        Base::operator=(other);
+        // Don't copy _mutex.
+        return *this;
+    }
+
+
+    CoreSegment& CoreSegment::operator=(CoreSegment&& other)
+    {
+        Base::operator=(other);
+        // Don't move _mutex.
+        return *this;
+    }
+
+
     Commit CoreSegment::toCommit() const
     {
         Commit c;
diff --git a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.h b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.h
index ef4d5f36d..351ab40f8 100644
--- a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.h
+++ b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.h
@@ -25,9 +25,9 @@ namespace armarx::armem::wm
         using Base::CoreSegmentBase;
 
         CoreSegment(const CoreSegment& other);
-        CoreSegment(CoreSegment&& other) = default;
-        CoreSegment& operator=(const CoreSegment& other) = default;
-        CoreSegment& operator=(CoreSegment&& other) = default;
+        CoreSegment(CoreSegment&& other);
+        CoreSegment& operator=(const CoreSegment& other);
+        CoreSegment& operator=(CoreSegment&& other);
 
         /**
          * @brief Convert the content of this segmnet into a commit
-- 
GitLab