From 2442ddac2b60d860ed49c2abc1be0816e2fcdfe9 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Fri, 24 May 2024 13:26:17 -0400 Subject: [PATCH] Assertions only in debug builds. --- assertion.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assertion.h b/assertion.h index 17f4b07..8acd81c 100644 --- a/assertion.h +++ b/assertion.h @@ -15,11 +15,13 @@ namespace Alepha::Hydrogen ::detail:: assertion_m inline void assertion( const bool b ) { + #ifndef NDEBUG if( not b ) { throw build_exception< ProgrammerExpectationViolation >( "Expectation violated." ); } + #endif } } }