Use unique_ptr in nonbonded_verlet_t
[alexxy/gromacs.git] / src / gromacs / mdtypes / forcerec.h
index 915381691dda82b739e999b2f9b46852b1ca3714..e90470a62a8145907ce1b1b00a0995db9340c8a4 100644 (file)
@@ -38,6 +38,7 @@
 #define GMX_MDTYPES_TYPES_FORCEREC_H
 
 #include <array>
+#include <memory>
 #include <vector>
 
 #include "gromacs/math/vectypes.h"
@@ -229,7 +230,9 @@ struct t_forcerec { // NOLINT (clang-analyzer-optin.performance.Padding)
 
     int                        cutoff_scheme = 0;     /* group- or Verlet-style cutoff */
     gmx_bool                   bNonbonded    = FALSE; /* true if nonbonded calculations are *not* turned off */
-    struct nonbonded_verlet_t *nbv           = nullptr;
+
+    /* The Nbnxm Verlet non-bonded machinery */
+    std::unique_ptr<nonbonded_verlet_t> nbv;
 
     /* The wall tables (if used) */
     int                    nwall    = 0;