From 4fd67d8cc8be473c134283ba4a5bde02142f4849 Mon Sep 17 00:00:00 2001 From: sgorbuno <se.gorbunov@gsi.de> Date: Fri, 23 Jul 2021 11:20:44 +0000 Subject: [PATCH] L1: fix -Wdeprecated-copy warning in L1Vector --- reco/L1/L1Algo/L1Vector.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/reco/L1/L1Algo/L1Vector.h b/reco/L1/L1Algo/L1Vector.h index e286b1a6d4..10a28b7a7e 100644 --- a/reco/L1/L1Algo/L1Vector.h +++ b/reco/L1/L1Algo/L1Vector.h @@ -42,13 +42,16 @@ public: { } - L1Vector(const L1Vector& v) : Tbase(), fName(v.fName) + L1Vector(const L1Vector& v) : Tbase() { *this = v; } + + L1Vector& operator=(const L1Vector& v) { - Tbase::reserve(v.capacity()); + fName = v.fName; + Tbase::reserve(v.capacity()); // make sure that the capacity is transmitted Tbase::assign(v.begin(), v.end()); + return *this; } - void SetName(const std::string& s) { fName = s; } void SetName(const std::basic_ostream<char>& s) -- GitLab