From 76e3218e13c9881ffb912cb354aca14871b44002 Mon Sep 17 00:00:00 2001 From: Luke Valenty Date: Tue, 7 Jan 2025 17:47:52 -0800 Subject: [PATCH] STATIC_PROOF fails compilation of a condition can't be proven --- include/stdx/static_assert.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/stdx/static_assert.hpp b/include/stdx/static_assert.hpp index 05d54e4..e433b57 100644 --- a/include/stdx/static_assert.hpp +++ b/include/stdx/static_assert.hpp @@ -46,3 +46,6 @@ template constexpr auto static_format() { }.template operator()() #endif + +#define STATIC_PROOF(cond) \ + if (not (cond)) asm("compiler cannot prove (" #cond ") is always true");