diff --git a/DDG4/include/DDG4/Geant4Handle.h b/DDG4/include/DDG4/Geant4Handle.h index 996c3b0317707b42c4655e7fa68ed3e8fc6d89cb..6560224cc072c3ba5f6593b346e4f97814103608 100644 --- a/DDG4/include/DDG4/Geant4Handle.h +++ b/DDG4/include/DDG4/Geant4Handle.h @@ -50,13 +50,13 @@ namespace DD4hep { : value(0) { checked_assign(dynamic_cast<handled_type*>(typ)); } - Geant4Handle(Geant4Handle& handle); + Geant4Handle(const Geant4Handle& handle); Geant4Handle(const Geant4Kernel&, const std::string& type_name); /// Constructor only implemented for sensitive objects Geant4Handle(const Geant4Kernel& ctxt, const std::string& type_name, const std::string& detector); ~Geant4Handle(); Property& operator[](const std::string& property_name) const; - Geant4Handle& operator=(Geant4Handle& handle); + Geant4Handle& operator=(const Geant4Handle& handle); Geant4Handle& operator=(handled_type* ptr); bool operator!() const; operator handled_type*() const; diff --git a/DDG4/src/Geant4Handle.cpp b/DDG4/src/Geant4Handle.cpp index aa7963cac9e8e6a3ca6afa147ff7cd929562f8d0..8b0c31939b073b45722dbbb350e8d3264c707f5f 100644 --- a/DDG4/src/Geant4Handle.cpp +++ b/DDG4/src/Geant4Handle.cpp @@ -49,7 +49,7 @@ template <typename TYPE> Geant4Handle<TYPE>::Geant4Handle(TYPE* typ) value->addRef(); } -template <typename TYPE> Geant4Handle<TYPE>::Geant4Handle(Geant4Handle<TYPE>& handle) +template <typename TYPE> Geant4Handle<TYPE>::Geant4Handle(const Geant4Handle<TYPE>& handle) : value(0) { value = handle.get(); if (value) @@ -132,7 +132,7 @@ template <typename TYPE> Geant4Action* Geant4Handle<TYPE>::action() const { return checked_value(value); } -template <typename TYPE> Geant4Handle<TYPE>& Geant4Handle<TYPE>::operator=(Geant4Handle& handle) { +template <typename TYPE> Geant4Handle<TYPE>& Geant4Handle<TYPE>::operator=(const Geant4Handle& handle) { if (value) value->release(); value = handle.get();