4 ms·
Yeah, I mean that's just a normal `assert()` from <assert.h> and it doesn't solve the problem because nobody runs debug builds in production neither it is possi
by menaerus 5y ago
Yeah, I mean that's just a normal `assert()` from <assert.h> and it doesn't solve the problem because nobody runs debug builds in production neither it is possible in a reasonably complex software predict in what ways your users are going to be using it and therefore cause bugs you'd never have imagined that could happen.
But speaking of asserts, there could be a runtime assert but which is also _kept_ in release builds. On detection of invariant not being valid, it would just crash the program. That approach works for some fields in engineering but not so much in others however it could be considered as an alternative.