Preven extension of DDBondedChecking
authorejjordan <ejjordan@kth.se>
Tue, 4 May 2021 08:13:32 +0000 (10:13 +0200)
committerPaul Bauer <paul.bauer.q@gmail.com>
Tue, 4 May 2021 12:06:05 +0000 (12:06 +0000)
By having DDBondedChecking inherit from bool, any attempt to add
additional enum values will lead to compilation error, unless the
inheritance is also removed.

src/gromacs/domdec/domdec.h
src/gromacs/domdec/options.h

index b969eab4767e17e93bdca3307e7f62206fd18d36..42883d1598c210fff34f9209c0ebbaaa09e3d845 100644 (file)
@@ -94,7 +94,7 @@ class RangePartitioning;
 class VirtualSitesHandler;
 template<typename>
 class ArrayRef;
-enum class DDBondedChecking;
+enum class DDBondedChecking : bool;
 } // namespace gmx
 
 /*! \brief Returns the global topology atom number belonging to local atom index i.
index 2f6e858f926bfbc7f633f90c1310c68707c370cd..6d5b29174b766ef8e8b24b79f9b5d6290afb3ad8 100644 (file)
@@ -76,10 +76,10 @@ enum class DlbOption
 /*! \brief Options for checking bonded interactions.
  *
  * These values must match the bool false and true used for mdrun -ddcheck */
-enum class DDBondedChecking
+enum class DDBondedChecking : bool
 {
-    ExcludeZeroLimit = 0, //!< Do not check bonded interactions that go to 0 for large distances
-    All              = 1  //!< Check all bonded interactions
+    ExcludeZeroLimit = false, //!< Do not check bonded interactions that go to 0 for large distances
+    All              = true   //!< Check all bonded interactions
 };
 
 /*! \libinternal \brief Structure containing all (command line) options for the domain decomposition */