Re:Show HN: Design by Contract (tm) – C++
by guenthert on Sunday December 13, 2020 @02:25PM
(#25409303)
Uh, run-time tests using C-style macros, much like assertions. Frankly, I would have been more impressed by some template/constexpr magic implementing compile-time tests.
[ Parent
| on HN ]
You can't implement the assertions at compile time since they are predicates evaluated at runtime. This is also why it is a performance hit on the code. I chose to use C-style macros because it is easier to debug than templates.