Skip to content

Commit

Permalink
Removed a should from Exception.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Iximiel authored Dec 22, 2023
1 parent 1b176f2 commit 03074ed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tools/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,11 @@ class ExceptionTypeError :
#ifdef NDEBUG

// These are the versions used when compiling with NDEBUG flag.
// The condition is always true, so that the rest of the statement
// should be optimized away.
#define plumed_dbg_assert(test) plumed_assert(true)
#define plumed_dbg_massert(test,msg) plumed_massert(true,msg)
// The if constexpr(false) gurarantees that the compiler will optimize away the assertion
// We are not using an empty macro becasue the user may want to use the << operator

#define plumed_dbg_assert(test) if constexpr(false) plumed_assert(true)
#define plumed_dbg_massert(test,msg) if constexpr(false) plumed_massert(true,msg)

#else

Expand Down

0 comments on commit 03074ed

Please sign in to comment.