diff --git a/Generators/GeneratorObjects/GeneratorObjects/McEventCollection.h b/Generators/GeneratorObjects/GeneratorObjects/McEventCollection.h
index bc193502de52e244820032c07b0588c7552e12f9..a96d9b1384827d8051d45bb112e2f895c5fd5bc3 100644
--- a/Generators/GeneratorObjects/GeneratorObjects/McEventCollection.h
+++ b/Generators/GeneratorObjects/GeneratorObjects/McEventCollection.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GENERATOROBJECTSMCEVENTCOLLECTION_H
@@ -62,10 +62,9 @@ inline McEventCollection& McEventCollection::operator=(const McEventCollection&
 {
   // Force a deep copy on the DataVector
   //
-  for (EventConstIterator iter = in.begin();
-       iter != in.end(); iter++)
+  for (const HepMC::GenEvent* ev : in)
   {
-    DataVector<HepMC::GenEvent>::push_back(new HepMC::GenEvent(**iter));
+    DataVector<HepMC::GenEvent>::push_back(new HepMC::GenEvent(*ev));
   }
 
   return *this;