From 3eec16775d2a95ed3916f0c521490a484b036f08 Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:07:00 +0100 Subject: [PATCH] Make the PIDHandler class non-copyable (#390) * Make the PIDHandler class non-copyable * Add a comment about the deleted copy constructor and assignment --------- Co-authored-by: jmcarcell --- utils/include/edm4hep/utils/ParticleIDUtils.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/include/edm4hep/utils/ParticleIDUtils.h b/utils/include/edm4hep/utils/ParticleIDUtils.h index 640ec037e..d9c2791f6 100644 --- a/utils/include/edm4hep/utils/ParticleIDUtils.h +++ b/utils/include/edm4hep/utils/ParticleIDUtils.h @@ -55,8 +55,9 @@ class PIDHandler { public: PIDHandler() = default; ~PIDHandler() = default; - PIDHandler(const PIDHandler&) = default; - PIDHandler& operator=(const PIDHandler&) = default; + // Copies are not allowed to avoid copying the internal maps + PIDHandler(const PIDHandler&) = delete; + PIDHandler& operator=(const PIDHandler&) = delete; PIDHandler(PIDHandler&&) = default; PIDHandler& operator=(PIDHandler&&) = default;