From 45a787e87a4e53117379aa7390e69fae25f995a5 Mon Sep 17 00:00:00 2001
From: Ben Couturier <ben.couturier@cern.ch>
Date: Tue, 9 Nov 2021 22:44:07 +0100
Subject: [PATCH] Removed move constructor and move assignment operator

---
 DDCore/include/DD4hep/detail/ConditionsInterna.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/DDCore/include/DD4hep/detail/ConditionsInterna.h b/DDCore/include/DD4hep/detail/ConditionsInterna.h
index 8d600473c..518dc06c8 100644
--- a/DDCore/include/DD4hep/detail/ConditionsInterna.h
+++ b/DDCore/include/DD4hep/detail/ConditionsInterna.h
@@ -54,6 +54,12 @@ namespace dd4hep {
      *  \author  M.Frank
      *  \version 1.0
      *  \ingroup DD4HEP_CONDITIONS
+     *
+     * The copy and move constructors have been removed from this class. It would be
+     * unsafe to copy or move an instance of it as:
+     *  - we do not know how to copy the OpaqueDataBlock member "data"
+     *  - there are potentially Handles pointing to instantiated ConditionObjects that would be invalid
+     *    after a copy or move.
      */
     class ConditionObject
 #if defined(DD4HEP_CONDITIONS_HAVE_NAME)
@@ -85,16 +91,16 @@ namespace dd4hep {
       ConditionObject();
       /// No copy constructor
       ConditionObject(const ConditionObject&) = delete;
-      // Move constructor
-      ConditionObject(ConditionObject&&) = default;
+      // No move constructor
+      ConditionObject(ConditionObject&&) = delete;
       /// Standard constructor
       ConditionObject(const std::string& nam,const std::string& tit="");
       /// Standard Destructor
       virtual ~ConditionObject();
       /// No assignment operation
       ConditionObject& operator=(const ConditionObject&) = delete;
-      /// Move assignment operator
-      ConditionObject& operator=(ConditionObject&&) = default;
+      /// No move assignment operator
+      ConditionObject& operator=(ConditionObject&&) = delete;
       /// Increase reference counter (Used by persistency mechanism)
       ConditionObject* addRef()  {  ++refCount; return this;         }
       /// Release object (Used by persistency mechanism)
-- 
GitLab