From 7d7602f6e9a7a1025c1d8994b1f848a69b3a37bd Mon Sep 17 00:00:00 2001 From: DarkSharpness <2040703891@qq.com> Date: Thu, 11 Jul 2024 18:47:17 +0800 Subject: [PATCH] feat(debug): disable debug in non-debug mode --- include/debug.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/debug.h b/include/debug.h index 601d3f4..4952ac1 100644 --- a/include/debug.h +++ b/include/debug.h @@ -24,6 +24,7 @@ namespace dark::debug { template struct assert { +#ifdef _DEBUG explicit assert(_Tp &&condition, _Args &&...args, std::source_location location = std::source_location::current()) { if (condition) return; @@ -35,6 +36,9 @@ struct assert { } std::exit(EXIT_FAILURE); } +#else + explicit assert(_Tp &&, _Args &&...) {} +#endif }; template