[Rivet-svn] rivet: Hide copy constructor and operator= of FinalState to avoi...

Rivet Mercurial rivet at projects.hepforge.org
Tue Jul 14 15:45:02 BST 2015


details:   https://rivet.hepforge.org/hg/rivet/rev/e5ccb6b4c68d
branches:  
changeset: 4810:e5ccb6b4c68d
user:      Frank Siegert <frank.siegert at cern.ch>
date:      Tue Jul 14 16:43:08 2015 +0200
description:
Hide copy constructor and operator= of FinalState to avoid accidental slicing of derived projections when one of these is used by a user.

diffs (18 lines):

--- a/include/Rivet/Projections/FinalState.hh	Mon Jul 13 13:21:02 2015 +0100
+++ b/include/Rivet/Projections/FinalState.hh	Tue Jul 14 16:43:08 2015 +0200
@@ -7,10 +7,14 @@
 
 namespace Rivet {
 
-
   /// @brief Project out all final-state particles in an event.
   /// Probably the most important projection in Rivet!
   class FinalState : public ParticleFinder {
+  private:
+    // hide lossy copy constructors for all classes derived from FinalState
+    template<typename T> FinalState(const T& rhs);
+    template<typename T> FinalState const& operator=(T const& rhs);
+
   public:
 
     /// @name Standard constructors etc.


More information about the Rivet-svn mailing list