A
Angel Tsankov
I need to make verifications in release builds. If a verification
fails, an error message should be displayed and the program should be
aborted. I need this solution to be portable. Then I thought of the
assert macro - it provides the desired functionality but only if
NDEBUG is not defined. So, I could write smth like this:
#if defined NDEBUG
#undef NDEBUG
#include <cassert>
#define NDEBUG
#else
#include <cassert>
#endif
Unfortunately, NDEBUG could be defined to something meaningful, in
which case it's value would be lost.
Can anyone think of some other way to use the assert macro for
verification?
What about any other options?
Regards,
Angel Tsankov
fails, an error message should be displayed and the program should be
aborted. I need this solution to be portable. Then I thought of the
assert macro - it provides the desired functionality but only if
NDEBUG is not defined. So, I could write smth like this:
#if defined NDEBUG
#undef NDEBUG
#include <cassert>
#define NDEBUG
#else
#include <cassert>
#endif
Unfortunately, NDEBUG could be defined to something meaningful, in
which case it's value would be lost.
Can anyone think of some other way to use the assert macro for
verification?
What about any other options?
Regards,
Angel Tsankov